From cd0e7e7894df7910bcaa82ea010e6070b155baa4 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 5 Jan 2024 06:27:23 +0000 Subject: [PATCH] Auto-generated commit --- .github/.keepalive | 1 - array/exponential/README.md | 22 + .../benchmark/benchmark.float32.assign.js | 97 ++++ .../benchmark/benchmark.float64.assign.js | 97 ++++ .../benchmark/benchmark.generic.assign.js | 97 ++++ array/exponential/docs/repl.txt | 26 + array/exponential/docs/types/index.d.ts | 45 +- array/exponential/docs/types/test.ts | 55 +- array/exponential/lib/defaults.json | 3 - array/exponential/lib/factory.js | 227 +------- array/exponential/lib/index.js | 2 +- array/exponential/test/test.assign.js | 118 ++++ array/exponential/test/test.factory.js | 8 +- array/exponential/test/test.js | 5 + array/exponential/test/test.main.js | 4 +- array/exponential/test/test.validate.js | 118 ---- array/geometric/README.md | 14 +- array/geometric/docs/repl.txt | 163 ++++++ array/geometric/docs/types/index.d.ts | 19 +- array/geometric/docs/types/test.ts | 8 +- array/geometric/lib/defaults.json | 3 - array/geometric/lib/factory.js | 231 +------- array/geometric/lib/index.js | 12 +- array/geometric/lib/main.js | 8 +- array/geometric/test/test.validate.js | 118 ---- array/tools/nullary/README.md | 178 ++++++ .../nullary/benchmark/benchmark.assign.js | 105 ++++ .../nullary/benchmark/benchmark.generate.js | 101 ++++ array/tools/nullary/benchmark/benchmark.js | 93 +++ array/tools/nullary/docs/repl.txt | 85 +++ array/tools/nullary/docs/types/index.d.ts | 196 +++++++ array/tools/nullary/docs/types/test.ts | 246 ++++++++ array/tools/nullary/examples/index.js | 44 ++ array/tools/nullary/lib/index.js | 46 ++ array/tools/nullary/lib/main.js | 174 ++++++ .../nullary}/lib/validate.js | 18 +- array/tools/nullary/package.json | 71 +++ array/tools/nullary/test/test.js | 33 ++ array/tools/unary-factory/README.md | 539 ++++++++++++++++++ .../benchmark/benchmark.assign.js | 107 ++++ .../unary-factory/benchmark/benchmark.js | 124 ++++ .../benchmark/benchmark.length.js | 103 ++++ array/tools/unary-factory/docs/repl.txt | 53 ++ array/tools/unary-factory/examples/index.js | 47 ++ array/tools/unary-factory/lib/index.js | 49 ++ array/tools/unary-factory/lib/main.js | 313 ++++++++++ array/tools/unary-factory/package.json | 72 +++ array/tools/unary-factory/test/test.js | 33 ++ array/tools/unary/README.md | 180 ++++++ .../tools/unary/benchmark/benchmark.assign.js | 105 ++++ .../unary/benchmark/benchmark.generate.js | 101 ++++ array/tools/unary/benchmark/benchmark.js | 93 +++ array/tools/unary/docs/repl.txt | 88 +++ array/tools/unary/docs/types/index.d.ts | 199 +++++++ array/tools/unary/docs/types/test.ts | 248 ++++++++ array/tools/unary/examples/index.js | 44 ++ array/tools/unary/lib/index.js | 46 ++ array/tools/unary/lib/main.js | 190 ++++++ .../unary}/lib/validate.js | 18 +- array/tools/unary/package.json | 70 +++ array/tools/unary/test/test.js | 33 ++ dist/index.js | 2 +- dist/index.js.map | 8 +- 63 files changed, 4999 insertions(+), 757 deletions(-) delete mode 100644 .github/.keepalive create mode 100644 array/exponential/benchmark/benchmark.float32.assign.js create mode 100644 array/exponential/benchmark/benchmark.float64.assign.js create mode 100644 array/exponential/benchmark/benchmark.generic.assign.js delete mode 100644 array/exponential/lib/defaults.json create mode 100644 array/exponential/test/test.assign.js delete mode 100644 array/exponential/test/test.validate.js create mode 100644 array/geometric/docs/repl.txt delete mode 100644 array/geometric/lib/defaults.json delete mode 100644 array/geometric/test/test.validate.js create mode 100644 array/tools/nullary/README.md create mode 100644 array/tools/nullary/benchmark/benchmark.assign.js create mode 100644 array/tools/nullary/benchmark/benchmark.generate.js create mode 100644 array/tools/nullary/benchmark/benchmark.js create mode 100644 array/tools/nullary/docs/repl.txt create mode 100644 array/tools/nullary/docs/types/index.d.ts create mode 100644 array/tools/nullary/docs/types/test.ts create mode 100644 array/tools/nullary/examples/index.js create mode 100644 array/tools/nullary/lib/index.js create mode 100644 array/tools/nullary/lib/main.js rename array/{geometric => tools/nullary}/lib/validate.js (79%) create mode 100644 array/tools/nullary/package.json create mode 100644 array/tools/nullary/test/test.js create mode 100644 array/tools/unary-factory/README.md create mode 100644 array/tools/unary-factory/benchmark/benchmark.assign.js create mode 100644 array/tools/unary-factory/benchmark/benchmark.js create mode 100644 array/tools/unary-factory/benchmark/benchmark.length.js create mode 100644 array/tools/unary-factory/docs/repl.txt create mode 100644 array/tools/unary-factory/examples/index.js create mode 100644 array/tools/unary-factory/lib/index.js create mode 100644 array/tools/unary-factory/lib/main.js create mode 100644 array/tools/unary-factory/package.json create mode 100644 array/tools/unary-factory/test/test.js create mode 100644 array/tools/unary/README.md create mode 100644 array/tools/unary/benchmark/benchmark.assign.js create mode 100644 array/tools/unary/benchmark/benchmark.generate.js create mode 100644 array/tools/unary/benchmark/benchmark.js create mode 100644 array/tools/unary/docs/repl.txt create mode 100644 array/tools/unary/docs/types/index.d.ts create mode 100644 array/tools/unary/docs/types/test.ts create mode 100644 array/tools/unary/examples/index.js create mode 100644 array/tools/unary/lib/index.js create mode 100644 array/tools/unary/lib/main.js rename array/{exponential => tools/unary}/lib/validate.js (79%) create mode 100644 array/tools/unary/package.json create mode 100644 array/tools/unary/test/test.js diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 4cf1bfa5..00000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-01-01T05:42:45.586Z diff --git a/array/exponential/README.md b/array/exponential/README.md index 2eb3ee86..3f1395bf 100644 --- a/array/exponential/README.md +++ b/array/exponential/README.md @@ -60,6 +60,28 @@ var out = exponential( 10, 2.0, opts ); // returns [...] ``` +#### exponential.assign( lambda, out ) + +Fills an array with pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution. + +```javascript +var zeros = require( '@stdlib/array/zeros' ); + +var x = zeros( 10, 'float64' ); +// returns + +var out = exponential.assign( 2.0, x ); +// returns + +var bool = ( out === x ); +// returns true +``` + +The function has the following parameters: + +- **lambda**: rate parameter. +- **out**: output array. + #### exponential.factory( \[lambda, ]\[options] ) Returns a function for creating arrays containing pseudorandom numbers drawn from an [exponential][@stdlib/random/base/exponential] distribution. diff --git a/array/exponential/benchmark/benchmark.float32.assign.js b/array/exponential/benchmark/benchmark.float32.assign.js new file mode 100644 index 00000000..cf1df064 --- /dev/null +++ b/array/exponential/benchmark/benchmark.float32.assign.js @@ -0,0 +1,97 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var zeros = require( '@stdlib/array/zeros' ); +var pkg = require( './../package.json' ).name; +var exponential = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var out; + var o; + var i; + + out = zeros( len, 'float32' ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = exponential.assign( 2.0, out ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':assign:dtype=float32,len='+len, f ); + } +} + +main(); diff --git a/array/exponential/benchmark/benchmark.float64.assign.js b/array/exponential/benchmark/benchmark.float64.assign.js new file mode 100644 index 00000000..29210b58 --- /dev/null +++ b/array/exponential/benchmark/benchmark.float64.assign.js @@ -0,0 +1,97 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var zeros = require( '@stdlib/array/zeros' ); +var pkg = require( './../package.json' ).name; +var exponential = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var out; + var o; + var i; + + out = zeros( len, 'float64' ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = exponential.assign( 2.0, out ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':assign:dtype=float64,len='+len, f ); + } +} + +main(); diff --git a/array/exponential/benchmark/benchmark.generic.assign.js b/array/exponential/benchmark/benchmark.generic.assign.js new file mode 100644 index 00000000..9a1d2a89 --- /dev/null +++ b/array/exponential/benchmark/benchmark.generic.assign.js @@ -0,0 +1,97 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var zeros = require( '@stdlib/array/zeros' ); +var pkg = require( './../package.json' ).name; +var exponential = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var out; + var o; + var i; + + out = zeros( len, 'generic' ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = exponential.assign( 2.0, out ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':assign:dtype=generic,len='+len, f ); + } +} + +main(); diff --git a/array/exponential/docs/repl.txt b/array/exponential/docs/repl.txt index ff17bc1a..e09bbc80 100644 --- a/array/exponential/docs/repl.txt +++ b/array/exponential/docs/repl.txt @@ -28,6 +28,32 @@ +{{alias}}.assign( lambda, out ) + Fills an array with pseudorandom numbers drawn from an exponential + distribution. + + Parameters + ---------- + lambda: number + Rate parameter. + + out: Array|Float64Array|Float32Array + Output array. + + Returns + ------- + out: Array|Float64Array|Float32Array + Output array. + + Examples + -------- + > var x = {{alias:@stdlib/array/zeros}}( 3, 'float64' ); + > var out = {{alias}}.assign( 2.0, x ) + + > var bool = ( out === x ) + true + + {{alias}}.factory( [lambda, ][options] ) Returns a function for creating arrays containing pseudorandom numbers drawn from an exponential distribution. diff --git a/array/exponential/docs/types/index.d.ts b/array/exponential/docs/types/index.d.ts index 8deecb5e..1e85bafe 100644 --- a/array/exponential/docs/types/index.d.ts +++ b/array/exponential/docs/types/index.d.ts @@ -20,14 +20,9 @@ /// -import { RealFloatingPointDataType, FloatTypedArray } from '@stdlib/types/array'; +import { RealFloatingPointAndGenericDataType as DataType, FloatTypedArray } from '@stdlib/types/array'; import * as random from '@stdlib/types/random'; -/** -* Supported data types. -*/ -type DataType = RealFloatingPointDataType | 'generic'; - /** * Output array. */ @@ -125,6 +120,14 @@ interface UnaryFunction extends PRNG { * @returns output array */ ( len: number, options?: Options ): RandomArray; + + /** + * Fills an array with pseudorandom numbers drawn from an exponential distribution with rate parameter `lambda`. + * + * @param out - output array + * @returns output array + */ + assign( out: RandomArray ): RandomArray; } /** @@ -140,6 +143,15 @@ interface BinaryFunction extends PRNG { * @returns output array */ ( len: number, lambda: number, options?: Options ): RandomArray; + + /** + * Fills an array with pseudorandom numbers drawn from an exponential distribution with rate parameter `lambda`. + * + * @param lambda - rate parameter + * @param out - output array + * @returns output array + */ + assign( lambda: number, out: RandomArray ): RandomArray; } /** @@ -160,6 +172,27 @@ interface Random extends PRNG { */ ( len: number, lambda: number, options?: Options ): RandomArray; + /** + * Fills an array with pseudorandom numbers drawn from an exponential distribution with rate parameter `lambda`. + * + * @param lambda - rate parameter + * @param out - output array + * @returns output array + * + * @example + * var zeros = require( '@stdlib/array/zeros' ); + * + * var x = zeros( 10, 'float64' ); + * // returns + * + * var out = exponential( 2.0, out ); + * // returns + * + * var bool = ( out === x ); + * // returns true + */ + assign( lambda: number, out: RandomArray ): RandomArray; + /** * Returns a function for creating arrays containing pseudorandom numbers drawn from an exponential distribution. * diff --git a/array/exponential/docs/types/test.ts b/array/exponential/docs/types/test.ts index aa1005bd..6b9ff7f9 100644 --- a/array/exponential/docs/types/test.ts +++ b/array/exponential/docs/types/test.ts @@ -16,6 +16,7 @@ * limitations under the License. */ +import zeros = require( '@stdlib/array/zeros' ); import random = require( './index' ); @@ -23,9 +24,9 @@ import random = require( './index' ); // The function returns an array... { - random( 10, 2 ); // $ExpectType RandomArray - random( 10, 1 ); // $ExpectType RandomArray - random( 10, 1, {} ); // $ExpectType RandomArray + random( 10, 2.0 ); // $ExpectType RandomArray + random( 10, 1.0 ); // $ExpectType RandomArray + random( 10, 1.0, {} ); // $ExpectType RandomArray } // The compiler throws an error if the function is provided a first argument which is not a number... @@ -93,6 +94,46 @@ import random = require( './index' ); random( 10, 2.0, {}, {} ); // $ExpectError } +// Attached to the main export is an `assign` method which returns an array... +{ + const x = zeros( 10, 'float64' ); + + random.assign( 2.0, x ); // $ExpectType RandomArray +} + +// The compiler throws an error if the `assign` method is provided a first argument which is not a number... +{ + const x = zeros( 10, 'float64' ); + + random.assign( '5', x ); // $ExpectError + random.assign( true, x ); // $ExpectError + random.assign( false, x ); // $ExpectError + random.assign( null, x ); // $ExpectError + random.assign( [], x ); // $ExpectError + random.assign( {}, x ); // $ExpectError + random.assign( ( x: number ): number => x, x ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a valid output array... +{ + random.assign( 2.0, '5' ); // $ExpectError + random.assign( 2.0, 5 ); // $ExpectError + random.assign( 2.0, true ); // $ExpectError + random.assign( 2.0, false ); // $ExpectError + random.assign( 2.0, null ); // $ExpectError + random.assign( 2.0, {} ); // $ExpectError + random.assign( 2.0, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... +{ + const x = zeros( 10, 'float64' ); + + random.assign(); // $ExpectError + random.assign( 2.0 ); // $ExpectError + random.assign( x, 2.0, {} ); // $ExpectError +} + // Attached to main export is a `factory` method which returns a function... { random.factory( 2.0 ); // $ExpectType UnaryFunction @@ -141,14 +182,14 @@ import random = require( './index' ); random.factory( 2.0, { 'prng': null } ); // $ExpectError random.factory( 2.0, { 'prng': [] } ); // $ExpectError random.factory( 2.0, { 'prng': {} } ); // $ExpectError - random.factory( 2.0, { 'prng': true ); // $ExpectError + random.factory( 2.0, { 'prng': true } ); // $ExpectError random.factory( { 'prng': 123 } ); // $ExpectError random.factory( { 'prng': 'abc' } ); // $ExpectError random.factory( { 'prng': null } ); // $ExpectError random.factory( { 'prng': [] } ); // $ExpectError random.factory( { 'prng': {} } ); // $ExpectError - random.factory( { 'prng': true ); // $ExpectError + random.factory( { 'prng': true } ); // $ExpectError } // The compiler throws an error if the `factory` method is provided a `seed` option which is not a valid seed... @@ -175,7 +216,7 @@ import random = require( './index' ); random.factory( 2.0, { 'state': null } ); // $ExpectError random.factory( 2.0, { 'state': [] } ); // $ExpectError random.factory( 2.0, { 'state': {} } ); // $ExpectError - random.factory( 2.0, { 'state': true ); // $ExpectError + random.factory( 2.0, { 'state': true } ); // $ExpectError random.factory( 2.0, { 'state': ( x: number ): number => x } ); // $ExpectError random.factory( { 'state': 123 } ); // $ExpectError @@ -183,7 +224,7 @@ import random = require( './index' ); random.factory( { 'state': null } ); // $ExpectError random.factory( { 'state': [] } ); // $ExpectError random.factory( { 'state': {} } ); // $ExpectError - random.factory( { 'state': true ); // $ExpectError + random.factory( { 'state': true } ); // $ExpectError random.factory( { 'state': ( x: number ): number => x } ); // $ExpectError } diff --git a/array/exponential/lib/defaults.json b/array/exponential/lib/defaults.json deleted file mode 100644 index 83f4438c..00000000 --- a/array/exponential/lib/defaults.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dtype": "float64" -} diff --git a/array/exponential/lib/factory.js b/array/exponential/lib/factory.js index 07d92237..2ca66a1a 100644 --- a/array/exponential/lib/factory.js +++ b/array/exponential/lib/factory.js @@ -20,21 +20,15 @@ // MODULES // -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); -var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' ); -var constantFunction = require( '@stdlib/utils/constant-function' ); -var noop = require( '@stdlib/utils/noop' ); +var unaryFactory = require( './../../../array/tools/unary-factory' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var defaults = require( '@stdlib/array/defaults' ); var base = require( './../../../base/exponential' ); -var ctors = require( '@stdlib/array/typed-real-float-ctors' ); -var filledBy = require( '@stdlib/array/base/filled-by' ); -var nullary = require( '@stdlib/strided/base/nullary' ); -var unary = require( '@stdlib/strided/base/unary' ); -var format = require( '@stdlib/string/format' ); -var defaults = require( './defaults.json' ); -var validate = require( './validate.js' ); + + +// VARIABLES // + +var DTYPES = dtypes( 'real_floating_point_and_generic' ); // MAIN // @@ -42,6 +36,8 @@ var validate = require( './validate.js' ); /** * Returns a function for creating arrays containing pseudorandom numbers drawn from an exponential distribution. * +* @name factory +* @type {Function} * @param {PositiveNumber} [lambda] - rate parameter * @param {Options} [options] - function options * @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers @@ -71,208 +67,7 @@ var validate = require( './validate.js' ); * }); * // returns [...] */ -function factory() { - var options; - var nargs; - var opts; - var rand; - var prng; - var err; - - opts = { - 'dtype': defaults.dtype - }; - - nargs = arguments.length; - if ( nargs === 0 ) { - prng = base; - rand = exponential2; - } else if ( nargs === 1 ) { - options = arguments[ 0 ]; - prng = base.factory( options ); - if ( isNumber( options ) ) { - rand = exponential1; - } else { - err = validate( opts, options ); - if ( err ) { - throw err; - } - rand = exponential2; - } - } else if ( nargs === 2 ) { - options = arguments[ 1 ]; - prng = base.factory( arguments[ 0 ], options ); - err = validate( opts, options ); - if ( err ) { - throw err; - } - rand = exponential1; - } - if ( options && options.prng ) { - setReadOnly( rand, 'seed', null ); - setReadOnly( rand, 'seedLength', null ); - setReadWriteAccessor( rand, 'state', constantFunction( null ), noop ); - setReadOnly( rand, 'stateLength', null ); - setReadOnly( rand, 'byteLength', null ); - } else { - setReadOnlyAccessor( rand, 'seed', getSeed ); - setReadOnlyAccessor( rand, 'seedLength', getSeedLength ); - setReadWriteAccessor( rand, 'state', getState, setState ); - setReadOnlyAccessor( rand, 'stateLength', getStateLength ); - setReadOnlyAccessor( rand, 'byteLength', getStateSize ); - } - setReadOnly( rand, 'PRNG', prng.PRNG ); - return rand; - - /** - * Returns an array containing pseudorandom numbers drawn from an exponential distribution with rate parameter `lambda`. - * - * @private - * @param {NonNegativeInteger} len - array length - * @param {Options} [options] - function options - * @param {string} [options.dtype] - output array data type - * @throws {TypeError} first argument must be a nonnegative integer - * @throws {TypeError} options argument must be an object - * @throws {TypeError} must provide valid options - * @returns {(Array|TypedArray)} output array - */ - function exponential1( len, options ) { - var ctor; - var out; - var err; - var dt; - var o; - if ( !isNonNegativeInteger( len ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) ); - } - o = {}; - if ( arguments.length > 1 ) { - err = validate( o, options ); - if ( err ) { - throw err; - } - } - dt = o.dtype || opts.dtype; - if ( dt === 'generic' ) { - return filledBy( len, prng ); - } - ctor = ctors( dt ); - out = new ctor( len ); - nullary( [ out ], [ len ], [ 1 ], prng ); - return out; - } - - /** - * Returns an array containing pseudorandom numbers drawn from an exponential distribution with rate parameter `lambda`. - * - * @private - * @param {NonNegativeInteger} len - array length - * @param {PositiveNumber} lambda - rate parameter - * @param {Options} [options] - function options - * @param {string} [options.dtype] - output array data type - * @throws {TypeError} first argument must be a nonnegative integer - * @throws {TypeError} options argument must be an object - * @throws {TypeError} must provide valid options - * @returns {(Array|TypedArray)} output array - */ - function exponential2( len, lambda, options ) { - var ctor; - var out; - var err; - var dt; - var o; - if ( !isNonNegativeInteger( len ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) ); - } - o = {}; - if ( arguments.length > 2 ) { - err = validate( o, options ); - if ( err ) { - throw err; - } - } - // NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`. - dt = o.dtype || opts.dtype; - if ( dt === 'generic' ) { - return filledBy( len, wrapper ); - } - ctor = ctors( dt ); - out = new ctor( len ); - unary( [ [ lambda ], out ], [ len ], [ 0, 1 ], prng ); - return out; - - /** - * Applies parameters to a pseudorandom number generator function. - * - * @private - * @returns {number} pseudorandom number - */ - function wrapper() { - return prng( lambda ); - } - } - - /** - * Returns the PRNG seed. - * - * @private - * @returns {PRNGSeedMT19937} seed - */ - function getSeed() { - return rand.PRNG.seed; - } - - /** - * Returns the PRNG seed length. - * - * @private - * @returns {PositiveInteger} seed length - */ - function getSeedLength() { - return rand.PRNG.seedLength; - } - - /** - * Returns the PRNG state length. - * - * @private - * @returns {PositiveInteger} state length - */ - function getStateLength() { - return rand.PRNG.stateLength; - } - - /** - * Returns the PRNG state size (in bytes). - * - * @private - * @returns {PositiveInteger} state size (in bytes) - */ - function getStateSize() { - return rand.PRNG.byteLength; - } - - /** - * Returns the current pseudorandom number generator state. - * - * @private - * @returns {PRNGStateMT19937} current state - */ - function getState() { - return rand.PRNG.state; - } - - /** - * Sets the pseudorandom number generator state. - * - * @private - * @param {PRNGStateMT19937} s - generator state - * @throws {Error} must provide a valid state - */ - function setState( s ) { - rand.PRNG.state = s; - } -} +var factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) ); // EXPORTS // diff --git a/array/exponential/lib/index.js b/array/exponential/lib/index.js index cc3a95ef..805c25fe 100644 --- a/array/exponential/lib/index.js +++ b/array/exponential/lib/index.js @@ -74,4 +74,4 @@ setReadOnly( main, 'factory', factory ); module.exports = main; -// exports: { "factory": "main.factory" } +// exports: { "factory": "main.factory", "assign": "main.assign" } diff --git a/array/exponential/test/test.assign.js b/array/exponential/test/test.assign.js new file mode 100644 index 00000000..321305bd --- /dev/null +++ b/array/exponential/test/test.assign.js @@ -0,0 +1,118 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var nans = require( '@stdlib/array/nans' ); +var random = require( './../lib/main.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof random, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is an `assign` method', function test( t ) { + t.strictEqual( typeof random.assign, 'function', 'has method' ); + t.end(); +}); + +tape( 'the method throws an error if provided a second argument which is not an array-like object', function test( t ) { + var values; + var i; + + values = [ + '5', + -5, + NaN, + null, + true, + false, + void 0, + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + random.assign( 2.0, value ); + }; + } +}); + +tape( 'the method fills an output array with pseudorandom numbers (dtype=float64)', function test( t ) { + var actual; + var out; + var i; + + out = nans( 10, 'float64' ); + actual = random.assign( 2.0, out ); + + t.strictEqual( out, actual, 'returns expected value' ); + t.strictEqual( actual.length, 10, 'returns expected value' ); + + for ( i = 0; i < actual.length; i++ ) { + t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i ); + } + t.end(); +}); + +tape( 'the method fills an output array with pseudorandom numbers (dtype=float32)', function test( t ) { + var actual; + var out; + var i; + + out = nans( 10, 'float32' ); + actual = random.assign( 2.0, out ); + + t.strictEqual( out, actual, 'returns expected value' ); + t.strictEqual( actual.length, 10, 'returns expected value' ); + + for ( i = 0; i < actual.length; i++ ) { + t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i ); + } + t.end(); +}); + +tape( 'the method fills an output array with pseudorandom numbers (dtype=generic)', function test( t ) { + var actual; + var out; + var i; + + out = nans( 10, 'generic' ); + actual = random.assign( 2.0, out ); + + t.strictEqual( out, actual, 'returns expected value' ); + t.strictEqual( actual.length, 10, 'returns expected value' ); + + for ( i = 0; i < actual.length; i++ ) { + t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i ); + } + t.end(); +}); diff --git a/array/exponential/test/test.factory.js b/array/exponential/test/test.factory.js index 85645561..e177beb1 100644 --- a/array/exponential/test/test.factory.js +++ b/array/exponential/test/test.factory.js @@ -807,7 +807,7 @@ tape( 'the function supports specifying the default output array data type (dtyp t.strictEqual( actual.length, 10, 'returns expected value' ); for ( i = 0; i < actual.length; i++ ) { - t.strictEqual( typeof actual[ i ], 'number', 'returns expected value for index '+i ); + t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i ); } random = factory({ @@ -819,7 +819,7 @@ tape( 'the function supports specifying the default output array data type (dtyp t.strictEqual( actual.length, 10, 'returns expected value' ); for ( i = 0; i < actual.length; i++ ) { - t.strictEqual( typeof actual[ i ], 'number', 'returns expected value for index '+i ); + t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i ); } t.end(); }); @@ -838,7 +838,7 @@ tape( 'the function supports specifying the default output array data type (dtyp t.strictEqual( actual.length, 10, 'returns expected value' ); for ( i = 0; i < actual.length; i++ ) { - t.strictEqual( typeof actual[ i ], 'number', 'returns expected value for index '+i ); + t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i ); } random = factory({ @@ -850,7 +850,7 @@ tape( 'the function supports specifying the default output array data type (dtyp t.strictEqual( actual.length, 10, 'returns expected value' ); for ( i = 0; i < actual.length; i++ ) { - t.strictEqual( typeof actual[ i ], 'number', 'returns expected value for index '+i ); + t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i ); } t.end(); }); diff --git a/array/exponential/test/test.js b/array/exponential/test/test.js index e7f16e57..7b028369 100644 --- a/array/exponential/test/test.js +++ b/array/exponential/test/test.js @@ -33,6 +33,11 @@ tape( 'main export is a function', function test( t ) { t.end(); }); +tape( 'attached to the main export is an `assign` method', function test( t ) { + t.strictEqual( typeof random.assign, 'function', 'has method' ); + t.end(); +}); + tape( 'attached to the main export is a `factory` method', function test( t ) { t.strictEqual( typeof random.factory, 'function', 'has method' ); t.end(); diff --git a/array/exponential/test/test.main.js b/array/exponential/test/test.main.js index 27dc9b01..bdcd450e 100644 --- a/array/exponential/test/test.main.js +++ b/array/exponential/test/test.main.js @@ -178,7 +178,7 @@ tape( 'the function supports specifying the output array data type (dtype=float6 t.strictEqual( actual.length, 10, 'returns expected value' ); for ( i = 0; i < actual.length; i++ ) { - t.strictEqual( typeof actual[ i ], 'number', 'returns expected value for index '+i ); + t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i ); } t.end(); }); @@ -195,7 +195,7 @@ tape( 'the function supports specifying the output array data type (dtype=float3 t.strictEqual( actual.length, 10, 'returns expected value' ); for ( i = 0; i < actual.length; i++ ) { - t.strictEqual( typeof actual[ i ], 'number', 'returns expected value for index '+i ); + t.strictEqual( actual[ i ], actual[ i ], 'returns expected value for index '+i ); } t.end(); }); diff --git a/array/exponential/test/test.validate.js b/array/exponential/test/test.validate.js deleted file mode 100644 index 9fbe15f9..00000000 --- a/array/exponential/test/test.validate.js +++ /dev/null @@ -1,118 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var validate = require( './../lib/validate.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof validate, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns an error if provided an options argument which is not an object', function test( t ) { - var values; - var err; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - void 0, - null, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - err = validate( {}, values[ i ] ); - t.equal( err instanceof TypeError, true, 'returns a type error when provided '+values[i] ); - } - t.end(); -}); - -tape( 'the function returns an error if provided a `dtype` option which is not a supported data type', function test( t ) { - var values; - var err; - var i; - - values = [ - '5', - -5, - NaN, - true, - false, - void 0, - null, - [], - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - err = validate( {}, { - 'dtype': values[ i ] - }); - t.equal( err instanceof TypeError, true, 'returns a type error when provided '+values[i] ); - } - t.end(); -}); - -tape( 'the function returns null if all options are valid', function test( t ) { - var options; - var opts; - var err; - - options = { - 'dtype': 'float64' - }; - opts = {}; - err = validate( opts, options ); - - t.equal( err, null, 'returns null' ); - t.deepEqual( opts, options, 'sets option values' ); - - t.end(); -}); - -tape( 'the function ignores unrecognized/unsupported options', function test( t ) { - var options; - var opts; - var err; - - options = { - 'beep': true, - 'boop': 'bop' - }; - opts = {}; - err = validate( opts, options ); - - t.equal( err, null, 'returns null' ); - t.deepEqual( opts, {}, 'does not set any option values' ); - t.end(); -}); diff --git a/array/geometric/README.md b/array/geometric/README.md index 1c4ffcdd..d6b2c222 100644 --- a/array/geometric/README.md +++ b/array/geometric/README.md @@ -20,7 +20,7 @@ limitations under the License. # Geometric Random Numbers -> Create an array containing pseudorandom numbers drawn from an [geometric][@stdlib/random/base/geometric] distribution. +> Create an array containing pseudorandom numbers drawn from a [geometric][@stdlib/random/base/geometric] distribution.
@@ -32,7 +32,7 @@ var geometric = require( '@stdlib/random/array/geometric' ); #### geometric( len, p\[, options] ) -Returns an array containing pseudorandom numbers drawn from an [geometric][@stdlib/random/base/geometric] distribution. +Returns an array containing pseudorandom numbers drawn from a [geometric][@stdlib/random/base/geometric] distribution. ```javascript var out = geometric( 10, 0.01 ); @@ -47,7 +47,7 @@ The function has the following parameters: The function accepts the following `options`: -- **dtype**: output array data type. Must be a [real-valued floating-point data type][@stdlib/array/typed-real-float-dtypes] or "generic". Default: `'float64'`. +- **dtype**: output array data type. Must be a [real-valued data type][@stdlib/array/typed-real-dtypes] or "generic". Default: `'float64'`. By default, the function returns a [`Float64Array`][@stdlib/array/float64]. To return an array having a different data type, set the `dtype` option. @@ -62,7 +62,7 @@ var out = geometric( 10, 0.01, opts ); #### geometric.factory( \[p, ]\[options] ) -Returns a function for creating arrays containing pseudorandom numbers drawn from an [geometric][@stdlib/random/base/geometric] distribution. +Returns a function for creating arrays containing pseudorandom numbers drawn from a [geometric][@stdlib/random/base/geometric] distribution. ```javascript var random = geometric.factory(); @@ -104,7 +104,7 @@ The function accepts the following `options`: - **seed**: pseudorandom number generator seed. - **state**: a [`Uint32Array`][@stdlib/array/uint32] containing pseudorandom number generator state. If provided, the function ignores the `seed` option. - **copy**: `boolean` indicating whether to copy a provided pseudorandom number generator state. Setting this option to `false` allows sharing state between two or more pseudorandom number generators. Setting this option to `true` ensures that an underlying generator has exclusive control over its internal state. Default: `true`. -- **dtype**: default output array data type. Must be a [real-valued floating-point data type][@stdlib/array/typed-real-float-dtypes] or "generic". Default: `'float64'`. +- **dtype**: default output array data type. Must be a [real-valued data type][@stdlib/array/typed-real-dtypes] or "generic". Default: `'float64'`. To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. @@ -134,7 +134,7 @@ var out = random( 10, opts ); The returned function accepts the following `options`: -- **dtype**: output array data type. Must be a [real-valued floating-point data type][@stdlib/array/typed-real-float-dtypes] or "generic". This overrides the default output array data type. +- **dtype**: output array data type. Must be a [real-valued data type][@stdlib/array/typed-real-dtypes] or "generic". This overrides the default output array data type. To override the default output array data type, set the `dtype` option. @@ -340,7 +340,7 @@ logEach( '%f', x4 ); [@stdlib/random/base/geometric]: https://github.com/stdlib-js/random/tree/main/base/geometric -[@stdlib/array/typed-real-float-dtypes]: https://github.com/stdlib-js/array-typed-real-float-dtypes +[@stdlib/array/typed-real-dtypes]: https://github.com/stdlib-js/array-typed-real-dtypes [@stdlib/array/uint32]: https://github.com/stdlib-js/array-uint32 diff --git a/array/geometric/docs/repl.txt b/array/geometric/docs/repl.txt new file mode 100644 index 00000000..6271c7ba --- /dev/null +++ b/array/geometric/docs/repl.txt @@ -0,0 +1,163 @@ + +{{alias}}( len, p[, options] ) + Returns an array containing pseudorandom numbers drawn from a geometric + distribution. + + Parameters + ---------- + len: integer + Output array length. + + p: number + Success probability (i.e., a value on the interval [0,1]). + + options: Object (optional) + Options. + + options.dtype: string (optional) + Output array data type. Default: 'float64'. + + Returns + ------- + out: Array|TypedArray + Output array. + + Examples + -------- + > var out = {{alias}}( 3, 0.01 ) + + + +{{alias}}.factory( [p, ][options] ) + Returns a function for creating arrays containing pseudorandom numbers drawn + from a geometric distribution. + + If provided `p`, the returned function returns random variates drawn from + the specified distribution. + + If not provided `p`, the returned function requires that `p` be provided at + each invocation. + + The returned function accepts the following options: + + - dtype: output array data type. This overrides the default output array + data type. + + Parameters + ---------- + p: number (optional) + Success probability (i.e., a value on the interval [0,1]). + + options: Object (optional) + Options. + + options.prng: Function (optional) + Pseudorandom number generator (PRNG) for generating uniformly + distributed pseudorandom numbers on the interval `[0,1)`. If provided, + the `state` and `seed` options are ignored. In order to seed the + returned pseudorandom number generator, one must seed the provided + `prng` (assuming the provided `prng` is seedable). + + options.seed: integer|ArrayLikeObject (optional) + Pseudorandom number generator seed. The seed may be either a positive + unsigned 32-bit integer or, for arbitrary length seeds, an array-like + object containing unsigned 32-bit integers. + + options.state: Uint32Array (optional) + Pseudorandom number generator state. If provided, the `seed` option is + ignored. + + options.copy: boolean (optional) + Boolean indicating whether to copy a provided pseudorandom number + generator state. Setting this option to `false` allows sharing state + between two or more pseudorandom number generators. Setting this option + to `true` ensures that a returned generator has exclusive control over + its internal state. Default: true. + + options.dtype: string (optional) + Default output array data type. Default: 'float64'. + + Returns + ------- + fcn: Function + Function for creating arrays. + + Examples + -------- + > var fcn = {{alias}}.factory(); + > var out = fcn( 3, 0.01 ) + + + // Provide distribution parameters: + > fcn = {{alias}}.factory( 0.01 ); + > out = fcn( 3 ) + + + +{{alias}}.PRNG + Underlying pseudorandom number generator. + + Examples + -------- + > var prng = {{alias}}.PRNG; + + +{{alias}}.seed + Pseudorandom number generator seed. + + Examples + -------- + > var seed = {{alias}}.seed; + + +{{alias}}.seedLength + Length of generator seed. + + Examples + -------- + > var len = {{alias}}.seedLength; + + +{{alias}}.state + Generator state. + + Examples + -------- + > var out = {{alias}}( 3, 0.01 ) + + + // Get a copy of the current state: + > var state = {{alias}}.state + + + > out = {{alias}}( 3, 0.01 ) + + > out = {{alias}}( 3, 0.01 ) + + + // Set the state: + > {{alias}}.state = state; + + // Regenerate a previous array: + > out = {{alias}}( 3, 0.01 ) + + + +{{alias}}.stateLength + Length of generator state. + + Examples + -------- + > var len = {{alias}}.stateLength; + + +{{alias}}.byteLength + Size (in bytes) of generator state. + + Examples + -------- + > var sz = {{alias}}.byteLength; + + See Also + -------- + diff --git a/array/geometric/docs/types/index.d.ts b/array/geometric/docs/types/index.d.ts index 7c95172b..732a1750 100644 --- a/array/geometric/docs/types/index.d.ts +++ b/array/geometric/docs/types/index.d.ts @@ -20,18 +20,13 @@ /// -import { RealFloatingPointDataType, FloatTypedArray } from '@stdlib/types/array'; +import { RealAndGenericDataType as DataType, RealTypedArray } from '@stdlib/types/array'; import * as random from '@stdlib/types/random'; -/** -* Supported data types. -*/ -type DataType = RealFloatingPointDataType | 'generic'; - /** * Output array. */ -type RandomArray = FloatTypedArray | Array; +type RandomArray = RealTypedArray | Array; /** * Interface defining PRNG options. @@ -118,7 +113,7 @@ interface PRNG { */ interface UnaryFunction extends PRNG { /** - * Returns an array containing pseudorandom numbers drawn from a geometric distribution with parameters `p` (success probability). + * Returns an array containing pseudorandom numbers drawn from a geometric distribution with success probability `p`. * * @param len - array length * @param options - function options @@ -132,7 +127,7 @@ interface UnaryFunction extends PRNG { */ interface BinaryFunction extends PRNG { /** - * Returns an array containing pseudorandom numbers drawn from a geometric distribution with parameters `p` (success probability). + * Returns an array containing pseudorandom numbers drawn from a geometric distribution with success probability `p`. * * @param len - array length * @param p - success probability @@ -147,7 +142,7 @@ interface BinaryFunction extends PRNG { */ interface Random extends PRNG { /** - * Returns an array containing pseudorandom numbers drawn from a geometric distribution with parameters `p` (success probability). + * Returns an array containing pseudorandom numbers drawn from a geometric distribution with success probability `p`. * * @param len - array length * @param p - success probability @@ -169,7 +164,7 @@ interface Random extends PRNG { * * @param p - success probability * @param options - function options - * @throws `p` must be a positive number + * @throws `p` must be a probability * @throws must provide a valid state * @returns function for creating arrays * @@ -216,7 +211,7 @@ interface Random extends PRNG { } /** -* Returns an array containing pseudorandom numbers drawn from a geometric distribution with parameter `p` (success probability). +* Returns an array containing pseudorandom numbers drawn from a geometric distribution with success probability `p`. * * @param len - array length * @param p - success probability diff --git a/array/geometric/docs/types/test.ts b/array/geometric/docs/types/test.ts index 4bf2a1bb..64e87599 100644 --- a/array/geometric/docs/types/test.ts +++ b/array/geometric/docs/types/test.ts @@ -141,14 +141,14 @@ import random = require( './index' ); random.factory( 0.01, { 'prng': null } ); // $ExpectError random.factory( 0.01, { 'prng': [] } ); // $ExpectError random.factory( 0.01, { 'prng': {} } ); // $ExpectError - random.factory( 0.01, { 'prng': true ); // $ExpectError + random.factory( 0.01, { 'prng': true } ); // $ExpectError random.factory( { 'prng': 123 } ); // $ExpectError random.factory( { 'prng': 'abc' } ); // $ExpectError random.factory( { 'prng': null } ); // $ExpectError random.factory( { 'prng': [] } ); // $ExpectError random.factory( { 'prng': {} } ); // $ExpectError - random.factory( { 'prng': true ); // $ExpectError + random.factory( { 'prng': true } ); // $ExpectError } // The compiler throws an error if the `factory` method is provided a `seed` option which is not a valid seed... @@ -175,7 +175,7 @@ import random = require( './index' ); random.factory( 0.01, { 'state': null } ); // $ExpectError random.factory( 0.01, { 'state': [] } ); // $ExpectError random.factory( 0.01, { 'state': {} } ); // $ExpectError - random.factory( 0.01, { 'state': true ); // $ExpectError + random.factory( 0.01, { 'state': true } ); // $ExpectError random.factory( 0.01, { 'state': ( x: number ): number => x } ); // $ExpectError random.factory( { 'state': 123 } ); // $ExpectError @@ -183,7 +183,7 @@ import random = require( './index' ); random.factory( { 'state': null } ); // $ExpectError random.factory( { 'state': [] } ); // $ExpectError random.factory( { 'state': {} } ); // $ExpectError - random.factory( { 'state': true ); // $ExpectError + random.factory( { 'state': true } ); // $ExpectError random.factory( { 'state': ( x: number ): number => x } ); // $ExpectError } diff --git a/array/geometric/lib/defaults.json b/array/geometric/lib/defaults.json deleted file mode 100644 index 18fbe686..00000000 --- a/array/geometric/lib/defaults.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dtype": "float64" -} \ No newline at end of file diff --git a/array/geometric/lib/factory.js b/array/geometric/lib/factory.js index d54b542e..b8a4ebf5 100644 --- a/array/geometric/lib/factory.js +++ b/array/geometric/lib/factory.js @@ -20,21 +20,15 @@ // MODULES // -var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); -var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' ); -var constantFunction = require( '@stdlib/utils/constant-function' ); -var noop = require( '@stdlib/utils/noop' ); +var unaryFactory = require( './../../../array/tools/unary-factory' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var defaults = require( '@stdlib/array/defaults' ); var base = require( './../../../base/geometric' ); -var ctors = require( '@stdlib/array/typed-real-float-ctors' ); -var filledBy = require( '@stdlib/array/base/filled-by' ); -var nullary = require( '@stdlib/strided/base/nullary' ); -var unary = require( '@stdlib/strided/base/unary' ); -var format = require( '@stdlib/string/format' ); -var defaults = require( './defaults.json' ); -var validate = require( './validate.js' ); + + +// VARIABLES // + +var DTYPES = dtypes( 'real_and_generic' ); // MAIN // @@ -42,14 +36,16 @@ var validate = require( './validate.js' ); /** * Returns a function for creating arrays containing pseudorandom numbers drawn from a geometric distribution. * -* @param {PositiveNumber} [p] - success probability +* @name factory +* @type {Function} +* @param {Probability} [p] - success probability * @param {Options} [options] - function options * @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers * @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed * @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state * @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state * @param {string} [options.dtype="float64"] - default data type -* @throws {TypeError} `p` must be a positive number +* @throws {TypeError} `p` must be a probability * @throws {TypeError} options argument must be an object * @throws {TypeError} must provide valid options * @throws {Error} must provide a valid state @@ -71,208 +67,7 @@ var validate = require( './validate.js' ); * }); * // returns [...] */ -function factory() { - var options; - var nargs; - var opts; - var rand; - var prng; - var err; - - opts = { - 'dtype': defaults.dtype - }; - - nargs = arguments.length; - if ( nargs === 0 ) { - prng = base; - rand = geometric2; - } else if ( nargs === 1 ) { - options = arguments[ 0 ]; - prng = base.factory( options ); - if ( isNumber( options ) ) { - rand = geometric1; - } else { - err = validate( opts, options ); - if ( err ) { - throw err; - } - rand = geometric2; - } - } else if ( nargs === 2 ) { - options = arguments[ 1 ]; - prng = base.factory( arguments[ 0 ], options ); - err = validate( opts, options ); - if ( err ) { - throw err; - } - rand = geometric1; - } - if ( options && options.prng ) { - setReadOnly( rand, 'seed', null ); - setReadOnly( rand, 'seedLength', null ); - setReadWriteAccessor( rand, 'state', constantFunction( null ), noop ); - setReadOnly( rand, 'stateLength', null ); - setReadOnly( rand, 'byteLength', null ); - } else { - setReadOnlyAccessor( rand, 'seed', getSeed ); - setReadOnlyAccessor( rand, 'seedLength', getSeedLength ); - setReadWriteAccessor( rand, 'state', getState, setState ); - setReadOnlyAccessor( rand, 'stateLength', getStateLength ); - setReadOnlyAccessor( rand, 'byteLength', getStateSize ); - } - setReadOnly( rand, 'PRNG', prng.PRNG ); - return rand; - - /** - * Returns an array containing pseudorandom numbers drawn from a geometric distribution with parameters `p`. - * - * @private - * @param {NonNegativeInteger} len - array length - * @param {Options} [options] - function options - * @param {string} [options.dtype] - output array data type - * @throws {TypeError} first argument must be a nonnegative integer - * @throws {TypeError} options argument must be an object - * @throws {TypeError} must provide valid options - * @returns {(Array|TypedArray)} output array - */ - function geometric1( len, options ) { - var ctor; - var out; - var err; - var dt; - var o; - if ( !isNonNegativeInteger( len ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) ); - } - o = {}; - if ( arguments.length > 1 ) { - err = validate( o, options ); - if ( err ) { - throw err; - } - } - dt = o.dtype || opts.dtype; - if ( dt === 'generic' ) { - return filledBy( len, prng ); - } - ctor = ctors( dt ); - out = new ctor( len ); - nullary( [ out ], [ len ], [ 1 ], prng ); - return out; - } - - /** - * Returns an array containing pseudorandom numbers drawn from a geometric distribution with parameters `p` (success probability). - * - * @private - * @param {NonNegativeInteger} len - array length - * @param {PositiveNumber} p - success probability - * @param {Options} [options] - function options - * @param {string} [options.dtype] - output array data type - * @throws {TypeError} first argument must be a nonnegative integer - * @throws {TypeError} options argument must be an object - * @throws {TypeError} must provide valid options - * @returns {(Array|TypedArray)} output array - */ - function geometric2( len, p, options ) { - var ctor; - var out; - var err; - var dt; - var o; - if ( !isNonNegativeInteger( len ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) ); - } - o = {}; - if ( arguments.length > 2 ) { - err = validate( o, options ); - if ( err ) { - throw err; - } - } - // NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`. - dt = o.dtype || opts.dtype; - if ( dt === 'generic' ) { - return filledBy( len, wrapper ); - } - ctor = ctors( dt ); - out = new ctor( len ); - unary( [ [ p ], out ], [ len ], [ 0, 1 ], prng ); - return out; - - /** - * Applies parameters to a pseudorandom number generator function. - * - * @private - * @returns {number} pseudorandom number - */ - function wrapper() { - return prng( p ); - } - } - - /** - * Returns the PRNG seed. - * - * @private - * @returns {PRNGSeedMT19937} seed - */ - function getSeed() { - return rand.PRNG.seed; - } - - /** - * Returns the PRNG seed length. - * - * @private - * @returns {PositiveInteger} seed length - */ - function getSeedLength() { - return rand.PRNG.seedLength; - } - - /** - * Returns the PRNG state length. - * - * @private - * @returns {PositiveInteger} state length - */ - function getStateLength() { - return rand.PRNG.stateLength; - } - - /** - * Returns the PRNG state size (in bytes). - * - * @private - * @returns {PositiveInteger} state size (in bytes) - */ - function getStateSize() { - return rand.PRNG.byteLength; - } - - /** - * Returns the current pseudorandom number generator state. - * - * @private - * @returns {PRNGStateMT19937} current state - */ - function getState() { - return rand.PRNG.state; - } - - /** - * Sets the pseudorandom number generator state. - * - * @private - * @param {PRNGStateMT19937} s - generator state - * @throws {Error} must provide a valid state - */ - function setState( s ) { - rand.PRNG.state = s; - } -} +var factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) ); // EXPORTS // diff --git a/array/geometric/lib/index.js b/array/geometric/lib/index.js index 374104d9..dfffc522 100644 --- a/array/geometric/lib/index.js +++ b/array/geometric/lib/index.js @@ -19,20 +19,20 @@ 'use strict'; /** -* Create an array containing pseudorandom numbers drawn from a geometric distribution with parameters `p` (success probability). +* Create an array containing pseudorandom numbers drawn from a geometric distribution with success probability `p`. * * @module @stdlib/random/array/geometric * * @example * var geometric = require( '@stdlib/random/array/geometric' ); * -* var arr = geometric( 10, 2.0 ); +* var arr = geometric( 10, 0.01 ); * // returns * * @example * var geometric = require( '@stdlib/random/array/geometric' ); * -* var arr = geometric( 10, 2.0,, { +* var arr = geometric( 10, 0.01, { * 'dtype': 'generic' * }); * // returns [...] @@ -40,7 +40,7 @@ * @example * var geometric = require( '@stdlib/random/array/geometric' ); * -* var rand = geometric.factory( 2.0 ); +* var rand = geometric.factory( 0.01 ); * // returns * * var arr = rand( 10 ); @@ -49,7 +49,7 @@ * @example * var geometric = require( '@stdlib/random/array/geometric' ); * -* var rand = geometric.factory( 2.0 ); +* var rand = geometric.factory( 0.01 ); * // returns * * var arr = rand( 10, { @@ -74,4 +74,4 @@ setReadOnly( main, 'factory', factory ); module.exports = main; -// exports: { "factory": "main.factory" } +// exports: { "factory": "main.factory", "assign": "main.assign" } diff --git a/array/geometric/lib/main.js b/array/geometric/lib/main.js index 4cd29a4a..e652c529 100644 --- a/array/geometric/lib/main.js +++ b/array/geometric/lib/main.js @@ -26,12 +26,12 @@ var factory = require( './factory.js' ); // MAIN // /** -* Returns an array containing pseudorandom numbers drawn from a geometric distribution with parameter `p` (success probability). +* Returns an array containing pseudorandom numbers drawn from a geometric distribution with success probability `p`. * * @name geometric * @type {Function} * @param {NonNegativeInteger} len - array length -* @param {PositiveNumber} p - success probability +* @param {Probability} p - success probability * @param {Options} [options] - options * @param {string} [options.dtype="float64"] - output array data type * @throws {TypeError} first argument must be a nonnegative integer @@ -40,11 +40,11 @@ var factory = require( './factory.js' ); * @returns {(Array|TypedArray)} output array * * @example -* var arr = geometric( 10, 2.0 ); +* var arr = geometric( 10, 0.01 ); * // returns * * @example -* var arr = geometric( 10, 2.0, { +* var arr = geometric( 10, 0.01, { * 'dtype': 'generic' * }); * // returns [...] diff --git a/array/geometric/test/test.validate.js b/array/geometric/test/test.validate.js deleted file mode 100644 index 9fbe15f9..00000000 --- a/array/geometric/test/test.validate.js +++ /dev/null @@ -1,118 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var validate = require( './../lib/validate.js' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof validate, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns an error if provided an options argument which is not an object', function test( t ) { - var values; - var err; - var i; - - values = [ - '5', - 5, - NaN, - true, - false, - void 0, - null, - [], - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - err = validate( {}, values[ i ] ); - t.equal( err instanceof TypeError, true, 'returns a type error when provided '+values[i] ); - } - t.end(); -}); - -tape( 'the function returns an error if provided a `dtype` option which is not a supported data type', function test( t ) { - var values; - var err; - var i; - - values = [ - '5', - -5, - NaN, - true, - false, - void 0, - null, - [], - {}, - function noop() {} - ]; - - for ( i = 0; i < values.length; i++ ) { - err = validate( {}, { - 'dtype': values[ i ] - }); - t.equal( err instanceof TypeError, true, 'returns a type error when provided '+values[i] ); - } - t.end(); -}); - -tape( 'the function returns null if all options are valid', function test( t ) { - var options; - var opts; - var err; - - options = { - 'dtype': 'float64' - }; - opts = {}; - err = validate( opts, options ); - - t.equal( err, null, 'returns null' ); - t.deepEqual( opts, options, 'sets option values' ); - - t.end(); -}); - -tape( 'the function ignores unrecognized/unsupported options', function test( t ) { - var options; - var opts; - var err; - - options = { - 'beep': true, - 'boop': 'bop' - }; - opts = {}; - err = validate( opts, options ); - - t.equal( err, null, 'returns null' ); - t.deepEqual( opts, {}, 'does not set any option values' ); - t.end(); -}); diff --git a/array/tools/nullary/README.md b/array/tools/nullary/README.md new file mode 100644 index 00000000..be74fa7f --- /dev/null +++ b/array/tools/nullary/README.md @@ -0,0 +1,178 @@ + + +# Nullary + +> Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG. + +
+ +## Usage + +```javascript +var Random = require( '@stdlib/random/array/tools/nullary' ); +``` + +#### Random( prng, dtypes, dtype ) + +Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; +var defaultDType = 'float64'; + +var random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); +``` + +The constructor has the following parameters: + +- **prng**: nullary pseudorandom value generator. +- **dtypes**: list of supported output data types. +- **dtype**: default output data type. + +#### Random.prototype.generate( len\[, options] ) + +Returns an array filled with pseudorandom values drawn from a nullary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; +var defaultDType = 'float64'; + +var random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); + +var v = random.generate( 10 ); +// returns +``` + +The method has the following parameters: + +- **len**: output array length. +- **options**: function options. + +The method accepts the following options: + +- **dtype**: output array data type. Setting this option, overrides the default output array data type. + +By default, the method returns an array having the default output array data type. To override the default, set the `dtype` option. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; +var defaultDType = 'float64'; + +var random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); + +var v = random.generate( 10, { + 'dtype': 'float32' +}); +// returns +``` + +#### Random.prototype.assign( out ) + +Fills an array with pseudorandom values drawn from a nullary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; +var defaultDType = 'float64'; + +var random = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); + +var out = zeros( 10, 'float64' ); +// returns + +var v = random.assign( out ); +// returns + +var bool = ( v === out ); +// returns true +``` + +The method has the following parameters: + +- **out**: output array. + +
+ + + +
+ +
+ + + +
+ +## Examples + + + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var Random = require( '@stdlib/random/array/tools/nullary' ); + +var dt = dtypes( 'real_floating_point' ); +dt.push( 'generic' ); + +var random = new Random( exponential.factory( 2.0 ), dt, 'float64' ); + +var x = random.generate( 10 ); +// returns + +x = random.generate( 10, { + 'dtype': 'float32' +}); +// returns + +x = random.generate( 10, { + 'dtype': 'generic' +}); +// returns [...] +``` + +
+ + + + + + + + + + + + + + diff --git a/array/tools/nullary/benchmark/benchmark.assign.js b/array/tools/nullary/benchmark/benchmark.assign.js new file mode 100644 index 00000000..caaf7773 --- /dev/null +++ b/array/tools/nullary/benchmark/benchmark.assign.js @@ -0,0 +1,105 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var exponential = require( './../../../../base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var zeros = require( '@stdlib/array/zeros' ); +var pkg = require( './../package.json' ).name; +var Random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var random; + var dt; + + dt = dtypes( 'real_floating_point' ); + random = new Random( exponential.factory( 2.0 ), dt, 'float64' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var out; + var o; + var i; + + out = zeros( len, 'float64' ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random.assign( out ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':assign:len='+len, f ); + } +} + +main(); diff --git a/array/tools/nullary/benchmark/benchmark.generate.js b/array/tools/nullary/benchmark/benchmark.generate.js new file mode 100644 index 00000000..4db744ba --- /dev/null +++ b/array/tools/nullary/benchmark/benchmark.generate.js @@ -0,0 +1,101 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var exponential = require( './../../../../base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var pkg = require( './../package.json' ).name; +var Random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var random; + var dt; + + dt = dtypes( 'real_floating_point' ); + random = new Random( exponential.factory( 2.0 ), dt, 'float64' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random.generate( len ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':generate:len='+len, f ); + } +} + +main(); diff --git a/array/tools/nullary/benchmark/benchmark.js b/array/tools/nullary/benchmark/benchmark.js new file mode 100644 index 00000000..d0563bf5 --- /dev/null +++ b/array/tools/nullary/benchmark/benchmark.js @@ -0,0 +1,93 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var exponential = require( './../../../../base/exponential' ); +var geometric = require( './../../../../base/geometric' ); +var pkg = require( './../package.json' ).name; +var Random = require( './../lib' ); + + +// MAIN // + +bench( pkg+'::new', function benchmark( b ) { + var values; + var dtypes; + var v; + var i; + + values = [ + exponential.factory( 2.0 ), + geometric.factory( 0.5 ) + ]; + dtypes = [ + 'float64', + 'float32' + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + v = new Random( values[ i%values.length ], dtypes, 'float64' ); + if ( typeof v !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( !( v instanceof Random ) ) { + b.fail( 'should return an instance' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( pkg+'::no_new', function benchmark( b ) { + var values; + var dtypes; + var random; + var v; + var i; + + values = [ + exponential.factory( 2.0 ), + geometric.factory( 0.5 ) + ]; + dtypes = [ + 'float64', + 'float32' + ]; + + random = Random; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + v = random( values[ i%values.length ], dtypes, 'float64' ); + if ( typeof v !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( !( v instanceof Random ) ) { + b.fail( 'should return an instance' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/array/tools/nullary/docs/repl.txt b/array/tools/nullary/docs/repl.txt new file mode 100644 index 00000000..57758be4 --- /dev/null +++ b/array/tools/nullary/docs/repl.txt @@ -0,0 +1,85 @@ + +{{alias}}( prng, dtypes, dtype ) + Constructor for creating arrays filled with pseudorandom values drawn from + a nullary PRNG. + + Parameters + ---------- + prng: Function + Unary pseudorandom value generator. + + dtypes: Array + List of supported output array data types. + + dtype: string + Default output array data type. + + Returns + ------- + out: Object + Instance having methods for creating filled arrays. + + Examples + -------- + > var dt = [ 'float64', 'float32', 'generic' ]; + > var fcn = {{alias:@stdlib/random/base/exponential}}.factory( 2.0 ); + > var out = {{alias}}( fcn, dt, 'float64' ); + + +{{alias}}.prototype.generate( len[, options] ) + Returns an array filled with pseudorandom values drawn from a nullary PRNG. + + Parameters + ---------- + len: integer + Output array length. + + options: Object (optional) + Function options. + + options.dtype: string (optional) + Output array data type. Setting this option overrides the default output + array data type. + + Returns + ------- + out: Array|TypedArray + Output array. + + Examples + -------- + > var dt = [ 'float64', 'float32', 'generic' ]; + > fcn = {{alias:@stdlib/random/base/exponential}}.factory( 2.0 ); + > var r = {{alias}}( fcn, dt, 'float64' ); + > var v = r.generate( 5 ) + + + +{{alias}}.prototype.assign( out ) + Fills an array with pseudorandom values drawn from a nullary PRNG. + + Parameters + ---------- + out: Array|TypedArray|Object + Output array. + + Returns + ------- + out: Array|TypedArray|Object + Output array. + + Examples + -------- + > var dt = [ 'float64', 'float32', 'generic' ]; + > var fcn = {{alias:@stdlib/random/base/exponential}}.factory( 2.0 ); + > var r = {{alias}}( fcn, dt, 'float64' ); + > var out = {{alias:@stdlib/array/zeros}}( 5, 'float64' ) + + > var v = r.assign( out ) + + > var bool = ( out === v ) + true + + See Also + -------- + diff --git a/array/tools/nullary/docs/types/index.d.ts b/array/tools/nullary/docs/types/index.d.ts new file mode 100644 index 00000000..9eeaa8e6 --- /dev/null +++ b/array/tools/nullary/docs/types/index.d.ts @@ -0,0 +1,196 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { DataType, ArrayLike, AccessorArrayLike } from '@stdlib/types/array'; +import { PRNG } from '@stdlib/types/random'; + +/** +* Output array. +*/ +type OutputArray = ArrayLike | AccessorArrayLike; + +/** +* Interface defining options. +*/ +interface Options { + /** + * Output array data type. + */ + dtype?: DataType; +} + +/** +* Interface for generating pseudorandom values drawn from a nullary PRNG. +*/ +interface NullaryPRNG extends PRNG { + /** + * Returns a pseudorandom value. + * + * @returns pseudorandom value + */ + (): U; +} + +/** +* Class for creating arrays filled with pseudorandom values drawn from a nullary PRNG. +*/ +declare class RandomArray { + /** + * Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG. + * + * @param prng - nullary pseudorandom value generator + * @param dtypes - list of supported output data types + * @param dtype - default output data type + * @returns instance + * + * @example + * var exponential = require( './../../../../../base/exponential' ); + * + * var dtypes = [ 'float64', 'float32', 'generic' ]; + * var defaultDType = 'float64'; + * + * var rand = new RandomArray( exponential.factory( 2.0 ), dtypes, defaultDType ); + * + * var v = rand.generate( 10 ); + * // returns + */ + constructor( prng: NullaryPRNG, dtypes: ArrayLike, dtype: DataType ); + + /** + * Returns an array filled with pseudorandom values drawn from a nullary PRNG. + * + * @param len - number of elements + * @param options - function options + * @returns output array + * + * @example + * var exponential = require( './../../../../../base/exponential' ); + * + * var dtypes = [ 'float64', 'float32', 'generic' ]; + * var defaultDType = 'float64'; + * + * var rand = new RandomArray( exponential.factory( 2.0 ), dtypes, defaultDType ); + * + * var v = rand.generate( 10 ); + * // returns + */ + generate( len: number, options?: Options ): OutputArray; + + /** + * Fills an array with pseudorandom values drawn from a nullary PRNG. + * + * @param out - output array + * @returns output array + * + * @example + * var exponential = require( './../../../../../base/exponential' ); + * var zeros = require( '@stdlib/array/zeros' ); + * + * var dtypes = [ 'float64', 'float32', 'generic' ]; + * var defaultDType = 'float64'; + * + * var rand = new RandomArray( exponential.factory( 2.0 ), dtypes, defaultDType ); + * + * var out = zeros( 10, 'float64' ); + * // returns + * + * var v = rand.assign( out ); + * // returns + * + * var bool = ( v === out ); + * // returns true + */ + assign( out: OutputArray ): OutputArray; +} + +/** +* Interface defining a constructor which is both "newable" and "callable". +*/ +interface RandomArrayConstructor { + /** + * Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG. + * + * @param prng - nullary pseudorandom value generator + * @param dtypes - list of supported output data types + * @param dtype - default output data type + * @returns instance + * + * @example + * var exponential = require( './../../../../../base/exponential' ); + * + * var dtypes = [ 'float64', 'float32', 'generic' ]; + * var defaultDType = 'float64'; + * + * var rand = new RandomArray( exponential.factory( 2.0 ), dtypes, defaultDType ); + * + * var v = rand.generate( 10 ); + * // returns + */ + new( prng: NullaryPRNG, dtypes: ArrayLike, dtype: DataType ): RandomArray; + + /** + * Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG. + * + * @param prng - nullary pseudorandom value generator + * @param dtypes - list of supported output data types + * @param dtype - default output data type + * @returns instance + * + * @example + * var exponential = require( './../../../../../base/exponential' ); + * + * var dtypes = [ 'float64', 'float32', 'generic' ]; + * var defaultDType = 'float64'; + * + * var rand = new RandomArray( exponential.factory( 2.0 ), dtypes, defaultDType ); + * + * var v = rand.generate( 10 ); + * // returns + */ + ( prng: NullaryPRNG, dtypes: ArrayLike, dtype: DataType ): RandomArray; +} + +/** +* Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG. +* +* @param prng - nullary pseudorandom value generator +* @param dtypes - list of supported output data types +* @param dtype - default output data type +* @returns instance +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* var defaultDType = 'float64'; +* +* var rand = new RandomArray( exponential.factory( 2.0 ), dtypes, defaultDType ); +* +* var v = rand.generate( 10 ); +* // returns +*/ +declare var ctor: RandomArrayConstructor; + + +// EXPORTS // + +export = ctor; diff --git a/array/tools/nullary/docs/types/test.ts b/array/tools/nullary/docs/types/test.ts new file mode 100644 index 00000000..8ac56fe7 --- /dev/null +++ b/array/tools/nullary/docs/types/test.ts @@ -0,0 +1,246 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable @typescript-eslint/no-unused-expressions */ + +/// + +import { DataType } from '@stdlib/types/array'; +import exponential = require( './../../../../../base/exponential' ); +import zeros = require( '@stdlib/array/zeros' ); +import Random = require( './index' ); + + +// TESTS // + +// The function returns an instance for generating arrays of pseudorandom values... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + new Random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); // $ExpectType RandomArray + + const random = Random; + random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); // $ExpectType RandomArray +} + +// The compiler throws an error if the function is provided a first argument which is not a PRNG function... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + new Random( '5', dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( 5, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( true, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( false, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( null, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( void 0, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( 'abc', dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( {}, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( ( x: number ): number => x, dtypes, dtypes[ 0 ] ); // $ExpectError + + const random = Random; + random( '5', dtypes, dtypes[ 0 ] ); // $ExpectError + random( 5, dtypes, dtypes[ 0 ] ); // $ExpectError + random( true, dtypes, dtypes[ 0 ] ); // $ExpectError + random( false, dtypes, dtypes[ 0 ] ); // $ExpectError + random( null, dtypes, dtypes[ 0 ] ); // $ExpectError + random( void 0, dtypes, dtypes[ 0 ] ); // $ExpectError + random( 'abc', dtypes, dtypes[ 0 ] ); // $ExpectError + random( {}, dtypes, dtypes[ 0 ] ); // $ExpectError + random( ( x: number ): number => x, dtypes, dtypes[ 0 ] ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a list of data types... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + new Random( exponential.factory( 2.0 ), '5', dtypes[ 0 ] ); // $ExpectError + new Random( exponential.factory( 2.0 ), 5, dtypes[ 0 ] ); // $ExpectError + new Random( exponential.factory( 2.0 ), true, dtypes[ 0 ] ); // $ExpectError + new Random( exponential.factory( 2.0 ), false, dtypes[ 0 ] ); // $ExpectError + new Random( exponential.factory( 2.0 ), null, dtypes[ 0 ] ); // $ExpectError + new Random( exponential.factory( 2.0 ), void 0, dtypes[ 0 ] ); // $ExpectError + new Random( exponential.factory( 2.0 ), 'abc', dtypes[ 0 ] ); // $ExpectError + new Random( exponential.factory( 2.0 ), {}, dtypes[ 0 ] ); // $ExpectError + new Random( exponential.factory( 2.0 ), ( x: number ): number => x, dtypes[ 0 ] ); // $ExpectError + + const random = Random; + random( exponential.factory( 2.0 ), '5', dtypes[ 0 ] ); // $ExpectError + random( exponential.factory( 2.0 ), 5, dtypes[ 0 ] ); // $ExpectError + random( exponential.factory( 2.0 ), true, dtypes[ 0 ] ); // $ExpectError + random( exponential.factory( 2.0 ), false, dtypes[ 0 ] ); // $ExpectError + random( exponential.factory( 2.0 ), null, dtypes[ 0 ] ); // $ExpectError + random( exponential.factory( 2.0 ), void 0, dtypes[ 0 ] ); // $ExpectError + random( exponential.factory( 2.0 ), 'abc', dtypes[ 0 ] ); // $ExpectError + random( exponential.factory( 2.0 ), {}, dtypes[ 0 ] ); // $ExpectError + random( exponential.factory( 2.0 ), ( x: number ): number => x, dtypes[ 0 ] ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a data type... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + new Random( exponential.factory( 2.0 ), dtypes, '5' ); // $ExpectError + new Random( exponential.factory( 2.0 ), dtypes, 5 ); // $ExpectError + new Random( exponential.factory( 2.0 ), dtypes, true ); // $ExpectError + new Random( exponential.factory( 2.0 ), dtypes, false ); // $ExpectError + new Random( exponential.factory( 2.0 ), dtypes, null ); // $ExpectError + new Random( exponential.factory( 2.0 ), dtypes, void 0 ); // $ExpectError + new Random( exponential.factory( 2.0 ), dtypes, 'abc' ); // $ExpectError + new Random( exponential.factory( 2.0 ), dtypes, {} ); // $ExpectError + new Random( exponential.factory( 2.0 ), dtypes, ( x: number ): number => x ); // $ExpectError + + const random = Random; + random( exponential.factory( 2.0 ), dtypes, '5' ); // $ExpectError + random( exponential.factory( 2.0 ), dtypes, 5 ); // $ExpectError + random( exponential.factory( 2.0 ), dtypes, true ); // $ExpectError + random( exponential.factory( 2.0 ), dtypes, false ); // $ExpectError + random( exponential.factory( 2.0 ), dtypes, null ); // $ExpectError + random( exponential.factory( 2.0 ), dtypes, void 0 ); // $ExpectError + random( exponential.factory( 2.0 ), dtypes, 'abc' ); // $ExpectError + random( exponential.factory( 2.0 ), dtypes, {} ); // $ExpectError + random( exponential.factory( 2.0 ), dtypes, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + new Random(); // $ExpectError + new Random( exponential.factory( 2.0 ) ); // $ExpectError + new Random( exponential.factory( 2.0 ), dtypes ); // $ExpectError + new Random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ], {} ); // $ExpectError + + const random = Random; + random(); // $ExpectError + random( exponential.factory( 2.0 ) ); // $ExpectError + random( exponential.factory( 2.0 ), dtypes ); // $ExpectError + random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ], {} ); // $ExpectError +} + +// The function returns an instance having a `generate` method which returns an array... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); + r1.generate( 10 ); // $ExpectType OutputArray + r1.generate( 10, {} ); // $ExpectType OutputArray + + const random = Random; + const r2 = random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); + r2.generate( 10 ); // $ExpectType OutputArray + r2.generate( 10, {} ); // $ExpectType OutputArray +} + +// The compiler throws an error if the `generate` method is provided a first argument which is not a number... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); + r1.generate( '5' ); // $ExpectError + r1.generate( true ); // $ExpectError + r1.generate( false ); // $ExpectError + r1.generate( null ); // $ExpectError + r1.generate( void 0 ); // $ExpectError + r1.generate( [] ); // $ExpectError + r1.generate( {} ); // $ExpectError + r1.generate( ( x: number ): number => x ); // $ExpectError + + r1.generate( '5', {} ); // $ExpectError + r1.generate( true, {} ); // $ExpectError + r1.generate( false, {} ); // $ExpectError + r1.generate( null, {} ); // $ExpectError + r1.generate( void 0, {} ); // $ExpectError + r1.generate( [], {} ); // $ExpectError + r1.generate( {}, {} ); // $ExpectError + r1.generate( ( x: number ): number => x, {} ); // $ExpectError +} + +// The compiler throws an error if the `generate` method is provided a second argument which is not an object... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); + r1.generate( 10, '5' ); // $ExpectError + r1.generate( 10, true ); // $ExpectError + r1.generate( 10, false ); // $ExpectError + r1.generate( 10, null ); // $ExpectError + r1.generate( 10, [] ); // $ExpectError + r1.generate( 10, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `generate` method is provided an invalid `dtype` option... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); + r1.generate( 10, { 'dtype': '5' } ); // $ExpectError + r1.generate( 10, { 'dtype': 5 } ); // $ExpectError + r1.generate( 10, { 'dtype': true } ); // $ExpectError + r1.generate( 10, { 'dtype': false } ); // $ExpectError + r1.generate( 10, { 'dtype': null } ); // $ExpectError + r1.generate( 10, { 'dtype': [] } ); // $ExpectError + r1.generate( 10, { 'dtype': {} } ); // $ExpectError + r1.generate( 10, { 'dtype': ( x: number ): number => x } ); // $ExpectError +} + +// The compiler throws an error if the `generate` method is provided an unsupported number of arguments... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); + r1.generate(); // $ExpectError + r1.generate( 10, {}, {} ); // $ExpectError +} + +// The function returns an instance having an `assign` method which returns an array... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + const x = zeros( 10, dtypes[ 0 ] ); + + const r1 = new Random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); + r1.assign( x ); // $ExpectType OutputArray + + const random = Random; + const r2 = random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); + r2.assign( x ); // $ExpectType OutputArray +} + +// The compiler throws an error if the `assign` method is provided a first argument which is not an array-like object... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); + r1.assign( '5' ); // $ExpectError + r1.assign( 5 ); // $ExpectError + r1.assign( true ); // $ExpectError + r1.assign( false ); // $ExpectError + r1.assign( null ); // $ExpectError + r1.assign( void 0 ); // $ExpectError + r1.assign( {} ); // $ExpectError + r1.assign( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + const x = zeros( 10, dtypes[ 0 ] ); + + const r1 = new Random( exponential.factory( 2.0 ), dtypes, dtypes[ 0 ] ); + r1.assign(); // $ExpectError + r1.assign( x, {} ); // $ExpectError +} diff --git a/array/tools/nullary/examples/index.js b/array/tools/nullary/examples/index.js new file mode 100644 index 00000000..86a1ac52 --- /dev/null +++ b/array/tools/nullary/examples/index.js @@ -0,0 +1,44 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var exponential = require( './../../../../base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var Random = require( './../lib' ); + +var dt = dtypes( 'real_floating_point' ); +dt.push( 'generic' ); + +var random = new Random( exponential.factory( 2.0 ), dt, 'float64' ); + +var x = random.generate( 10 ); +console.log( x ); +// => + +x = random.generate( 10, { + 'dtype': 'float32' +}); +console.log( x ); +// => + +x = random.generate( 10, { + 'dtype': 'generic' +}); +console.log( x ); +// => [...] diff --git a/array/tools/nullary/lib/index.js b/array/tools/nullary/lib/index.js new file mode 100644 index 00000000..6c57f2ce --- /dev/null +++ b/array/tools/nullary/lib/index.js @@ -0,0 +1,46 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG. +* +* @module @stdlib/random/array/tools/nullary +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* var Random = require( '@stdlib/random/array/tools/nullary' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* var defaultDType = 'float64'; +* +* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); +* +* var v = rand.generate( 10 ); +* // returns +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/array/tools/nullary/lib/main.js b/array/tools/nullary/lib/main.js new file mode 100644 index 00000000..34f7a21c --- /dev/null +++ b/array/tools/nullary/lib/main.js @@ -0,0 +1,174 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-restricted-syntax, no-invalid-this */ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; +var isFunction = require( '@stdlib/assert/is-function' ); +var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; +var isCollection = require( '@stdlib/assert/is-collection' ); +var contains = require( '@stdlib/array/base/assert/contains' ); +var filledBy = require( '@stdlib/array/base/filled-by' ); +var nullary = require( '@stdlib/strided/base/nullary' ); +var ctors = require( '@stdlib/array/ctors' ); +var format = require( '@stdlib/string/format' ); +var validate = require( './validate.js' ); + + +// MAIN // + +/** +* Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG. +* +* @constructor +* @param {Function} prng - nullary pseudorandom value generator +* @param {StringArray} dtypes - list of supported output data types +* @param {string} dtype - default output data type +* @throws {TypeError} first argument must be a function +* @throws {TypeError} second argument must be an array of strings +* @throws {TypeError} third argument must be a supported data type +* @returns {Random} instance +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* var defaultDType = 'float64'; +* +* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); +* +* var v = rand.generate( 10 ); +* // returns +*/ +function Random( prng, dtypes, dtype ) { + if ( !( this instanceof Random ) ) { + return new Random( prng, dtypes, dtype ); + } + if ( !isFunction( prng ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) ); + } + // TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings + if ( !isStringArray( dtypes ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) ); + } + // Require that the default output array data type be a member of the list of supported output array data types... + if ( !contains( dtypes, dtype ) ) { + throw new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) ); + } + this._prng = prng; + this._dtypes = dtypes; + this._dtype = dtype; + return this; +} + +/** +* Returns an array filled with pseudorandom values drawn from a nullary PRNG. +* +* @name generate +* @memberof Random.prototype +* @type {Function} +* @param {NonNegativeInteger} len - number of elements +* @param {Options} [options] - function options +* @param {string} [options.dtype] - array data type +* @throws {TypeError} first argument must be a nonnegative integer +* @throws {TypeError} options argument must be an object +* @throws {TypeError} must provide valid options +* @returns {Collection} output array +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* var defaultDType = 'float64'; +* +* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); +* +* var v = rand.generate( 10 ); +* // returns +*/ +setReadOnly( Random.prototype, 'generate', function generate( len, options ) { + var ctor; + var opts; + var out; + var err; + var dt; + if ( !isNonNegativeInteger( len ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) ); + } + opts = {}; + if ( arguments.length > 1 ) { + err = validate( opts, this._dtypes, options ); + if ( err ) { + throw err; + } + } + dt = opts.dtype || this._dtype; + if ( dt === 'generic' ) { + return filledBy( len, this._prng ); + } + ctor = ctors( dt ); + out = new ctor( len ); + nullary( [ out ], [ len ], [ 1 ], this._prng ); + return out; +}); + +/** +* Fills an array with pseudorandom values drawn from a nullary PRNG. +* +* @name assign +* @memberof Random.prototype +* @type {Function} +* @param {Collection} out - output array +* @throws {TypeError} first argument must be a collection +* @returns {Collection} output array +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* var zeros = require( '@stdlib/array/zeros' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* var defaultDType = 'float64'; +* +* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType ); +* +* var out = zeros( 10, 'float64' ); +* // returns +* +* var v = rand.assign( out ); +* // returns +* +* var bool = ( v === out ); +* // returns true +*/ +setReadOnly( Random.prototype, 'assign', function assign( out ) { + if ( !isCollection( out ) ) { + throw new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', out ) ); + } + nullary( [ out ], [ out.length ], [ 1 ], this._prng ); + return out; +}); + + +// EXPORTS // + +module.exports = Random; diff --git a/array/geometric/lib/validate.js b/array/tools/nullary/lib/validate.js similarity index 79% rename from array/geometric/lib/validate.js rename to array/tools/nullary/lib/validate.js index a31ee6b6..10d7d8be 100644 --- a/array/geometric/lib/validate.js +++ b/array/tools/nullary/lib/validate.js @@ -20,18 +20,12 @@ // MODULES // -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); var isObject = require( '@stdlib/assert/is-plain-object' ); var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var contains = require( '@stdlib/array/base/assert/contains' ); var format = require( '@stdlib/string/format' ); -// VARIABLES // - -var DTYPES = dtypes(); -DTYPES.push( 'generic' ); - - // MAIN // /** @@ -39,28 +33,30 @@ DTYPES.push( 'generic' ); * * @private * @param {Object} opts - destination object +* @param {Array} dtypes - list of supported output data types * @param {Options} options - function options * @param {string} [options.dtype] - output array data type * @returns {(Error|null)} null or an error object * * @example * var opts = {}; +* var dtypes = [ 'float64', 'float32', 'generic' ]; * var options = { * 'dtype': 'float64' * }; -* var err = validate( opts, options ); +* var err = validate( opts, dtypes, options ); * if ( err ) { * throw err; * } */ -function validate( opts, options ) { +function validate( opts, dtypes, options ) { if ( !isObject( options ) ) { return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); } if ( hasOwnProp( options, 'dtype' ) ) { opts.dtype = options.dtype; - if ( DTYPES.indexOf( opts.dtype ) < 0 ) { - return new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'dtype', DTYPES.join( '", "' ), opts.dtype ) ); + if ( !contains( dtypes, opts.dtype ) ) { + return new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'dtype', dtypes.join( '", "' ), opts.dtype ) ); } } return null; diff --git a/array/tools/nullary/package.json b/array/tools/nullary/package.json new file mode 100644 index 00000000..296de803 --- /dev/null +++ b/array/tools/nullary/package.json @@ -0,0 +1,71 @@ +{ + "name": "@stdlib/random/array/tools/nullary", + "version": "0.0.0", + "description": "Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "statistics", + "stats", + "tools", + "prng", + "rng", + "pseudorandom", + "random", + "rand", + "generator", + "seed", + "seedable", + "array", + "vector", + "nullary" + ] +} diff --git a/array/tools/nullary/test/test.js b/array/tools/nullary/test/test.js new file mode 100644 index 00000000..fedf52b6 --- /dev/null +++ b/array/tools/nullary/test/test.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Random = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof Random, 'function', 'main export is a function' ); + t.end(); +}); diff --git a/array/tools/unary-factory/README.md b/array/tools/unary-factory/README.md new file mode 100644 index 00000000..aeb2fd92 --- /dev/null +++ b/array/tools/unary-factory/README.md @@ -0,0 +1,539 @@ + + +# unaryFactory + +> Create a factory function for generating pseudorandom values drawn from a unary PRNG. + +
+ +## Usage + +```javascript +var unaryFactory = require( '@stdlib/random/array/tools/unary-factory' ); +``` + +#### unaryFactory( prng, dtypes, dtype ) + +Returns a factory function for generating pseudorandom values drawn from a unary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, 'float64' ); +// returns +``` + +The function has the following parameters: + +- **prng**: unary pseudorandom number generator. +- **dtypes**: list of supported output data types. +- **dtype**: default output array data type. + +* * * + +#### factory( \[param1, ]\[options] ) + +Returns a function for generating pseudorandom values drawn from a unary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory(); +// returns +``` + +The function has the following parameters: + +- **oaram1**: PRNG parameter. If provided a PRNG parameter, the function returns a partially applied function for creating arrays, which can be useful when wanting to pass around a parameterized function for array creation. +- **options**: function options. + +The function supports the following options: + +- **prng**: pseudorandom number generator which generates uniformly distributed pseudorandom numbers. +- **seed**: pseudorandom value generator seed. +- **state**: pseudorandom value generator state. +- **copy**: boolean indicating whether to copy a provided pseudorandom value generator state. +- **dtype**: default output array data type. Setting this option overrides the default output array data type provided to the parent function. + +* * * + +### Full Arity + +#### random( len, param1\[, options] ) + +Returns an array of pseudorandom values drawn from a unary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory(); +// returns + +var v = random( 10, 2.0 ); +// returns +``` + +The function has the following parameters: + +- **len**: output array length. +- **param1**: PRNG parameter. +- **options**: function options. + +The function accepts the following options: + +- **dtype**: output array data type. Setting this option overrides the default output array data type. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory(); +// returns + +var v = random( 10, 2.0, { + 'dtype': 'float32' +}); +// returns +``` + +#### random.assign( param1, out ) + +Fills an array with pseudorandom values drawn from a unary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory(); +// returns + +var out = zeros( 10, 'float64' ); +// returns + +var v = random.assign( 2.0, out ); +// returns + +var bool = ( out === v ); +// returns true +``` + +The method has the following parameters: + +- **param1**: PRNG parameter. +- **out**: output array. + +### Partial Application + +#### random( len\[, options] ) + +Returns an array of pseudorandom values drawn from a unary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory( 2.0 ); +// returns + +var v = random( 10 ); +// returns + +v = random( 10 ); +// returns +``` + +The function has the following parameters: + +- **len**: output array length. +- **options**: function options. + +The function accepts the following options: + +- **dtype**: output array data type. Setting this option overrides the default output array data type. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory( 2.0 ); +// returns + +var v = random( 10, { + 'dtype': 'float32' +}); +// returns + +v = random( 10, { + 'dtype': 'generic' +}); +// returns [...] +``` + +#### random.assign( out ) + +Fills an array with pseudorandom values drawn from a unary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory( 2.0 ); +// returns + +var out = zeros( 10, 'float64' ); +// returns + +var v = random.assign( out ); +// returns + +var bool = ( out === v ); +// returns true +``` + +The method has the following parameters: + +- **out**: output array. + +* * * + +#### random.PRNG + +The underlying pseudorandom number generator. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory(); +// returns + +var prng = random.PRNG; +// returns +``` + +#### random.seed + +The value used to seed the underlying pseudorandom number generator. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory(); +// returns + +var seed = random.seed; +// returns +``` + +If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. + +```javascript +var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory({ + 'prng': minstd +}); +// returns + +var seed = random.seed; +// returns null +``` + +#### random.seedLength + +Length of underlying pseudorandom number generator seed. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory(); +// returns + +var len = random.seedLength; +// returns +``` + +If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. + +```javascript +var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory({ + 'prng': minstd +}); +// returns + +var len = random.seedLength; +// returns null +``` + +#### random.state + +Writable property for getting and setting the underlying pseudorandom number generator state. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory(); +// returns + +var state = random.state; +// returns +``` + +If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. + +```javascript +var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory({ + 'prng': minstd +}); +// returns + +var state = random.state; +// returns null +``` + +#### random.stateLength + +Length of underlying pseudorandom number generator state. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory(); +// returns + +var len = random.stateLength; +// returns +``` + +If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. + +```javascript +var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory({ + 'prng': minstd +}); +// returns + +var len = random.stateLength; +// returns null +``` + +#### random.byteLength + +Size (in bytes) of underlying pseudorandom number generator state. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory(); +// returns + +var sz = random.byteLength; +// returns +``` + +If the `factory` function is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. + +```javascript +var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; + +var factory = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); +// returns + +var random = factory({ + 'prng': minstd +}); +// returns + +var sz = random.byteLength; +// returns null +``` + +
+ + + +
+ +
+ + + +
+ +* * * + +## Examples + + + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var unaryFactory = require( '@stdlib/random/array/tools/unary-factory' ); + +var dt = dtypes( 'real_floating_point_and_generic' ); + +var factory = unaryFactory( exponential, dt, 'float64' ); +// returns + +var random = factory(); +// returns + +var x = random( 10, 2.0 ); +// returns + +x = random( 10, 2.0, { + 'dtype': 'float32' +}); +// returns + +x = random( 10, 2.0, { + 'dtype': 'generic' +}); +// returns [...] +``` + +
+ + + + + + + + + + + + + + diff --git a/array/tools/unary-factory/benchmark/benchmark.assign.js b/array/tools/unary-factory/benchmark/benchmark.assign.js new file mode 100644 index 00000000..82068796 --- /dev/null +++ b/array/tools/unary-factory/benchmark/benchmark.assign.js @@ -0,0 +1,107 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var exponential = require( './../../../../base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var zeros = require( '@stdlib/array/zeros' ); +var pkg = require( './../package.json' ).name; +var unaryFactory = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var factory; + var random; + var dt; + + dt = dtypes( 'real_floating_point' ); + factory = unaryFactory( exponential, dt, dt[ 0 ] ); + random = factory(); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var out; + var o; + var i; + + out = zeros( len, 'float64' ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random.assign( 2.0, out ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+'::generate:assign:len='+len, f ); + } +} + +main(); diff --git a/array/tools/unary-factory/benchmark/benchmark.js b/array/tools/unary-factory/benchmark/benchmark.js new file mode 100644 index 00000000..96790494 --- /dev/null +++ b/array/tools/unary-factory/benchmark/benchmark.js @@ -0,0 +1,124 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var exponential = require( './../../../../base/exponential' ); +var geometric = require( './../../../../base/geometric' ); +var isFunction = require( '@stdlib/assert/is-function' ); +var pkg = require( './../package.json' ).name; +var unaryFactory = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var values; + var dtypes; + var f; + var i; + + values = [ + exponential, + geometric + ]; + dtypes = [ + 'float64', + 'float32' + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + f = unaryFactory( values[ i%values.length ], dtypes, dtypes[ 0 ] ); + if ( typeof f !== 'function' ) { + b.fail( 'should return a function' ); + } + } + b.toc(); + if ( !isFunction( f ) ) { + b.fail( 'should return a function' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( pkg+'::factory', function benchmark( b ) { + var dtypes; + var rand; + var f; + var i; + + dtypes = [ + 'float64', + 'float32', + 'generic' + ]; + f = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + rand = f(); + if ( typeof rand !== 'function' ) { + b.fail( 'should return a function' ); + } + } + b.toc(); + if ( !isFunction( rand ) ) { + b.fail( 'should return a function' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( pkg+'::factory,partial_application', function benchmark( b ) { + var values; + var dtypes; + var rand; + var f; + var i; + + dtypes = [ + 'float64', + 'float32', + 'generic' + ]; + f = unaryFactory( exponential, dtypes, dtypes[ 0 ] ); + + values = [ + 1.0, + 2.0, + 3.0 + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + rand = f( values[ i%values.length ] ); + if ( typeof rand !== 'function' ) { + b.fail( 'should return a function' ); + } + } + b.toc(); + if ( !isFunction( rand ) ) { + b.fail( 'should return a function' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/array/tools/unary-factory/benchmark/benchmark.length.js b/array/tools/unary-factory/benchmark/benchmark.length.js new file mode 100644 index 00000000..8c76cb26 --- /dev/null +++ b/array/tools/unary-factory/benchmark/benchmark.length.js @@ -0,0 +1,103 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var exponential = require( './../../../../base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var pkg = require( './../package.json' ).name; +var unaryFactory = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var factory; + var random; + var dt; + + dt = dtypes( 'real_floating_point' ); + factory = unaryFactory( exponential, dt, dt[ 0 ] ); + random = factory(); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, 2.0 ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+'::generate:len='+len, f ); + } +} + +main(); diff --git a/array/tools/unary-factory/docs/repl.txt b/array/tools/unary-factory/docs/repl.txt new file mode 100644 index 00000000..3f55d66d --- /dev/null +++ b/array/tools/unary-factory/docs/repl.txt @@ -0,0 +1,53 @@ + +{{alias}}( prng, dtypes, dtype ) + Returns a factory function for generating pseudorandom values drawn from a + unary PRNG. + + Parameters + ---------- + prng: Function + Unary pseudorandom value generator. + + dtypes: Array + List of supported output array data types. + + dtype: string + Default output array data type. + + Returns + ------- + fcn: Function + Factory function which returns a function for creating arrays. The + returned factory function accepts two optional arguments: + + - param1: PRNG parameter. + - options: function options. + + If provided a PRNG parameter, the factory function returns a partially + applied function for creating arrays. + + The function supports the following options: + + - prng: pseudorandom number generator which generates uniformly + distributed pseudorandom numbers. + - seed: pseudorandom value generator seed. + - state: pseudorandom value generator state. + - copy: boolean indicating whether to copy a provided pseudorandom value + generator state. + - dtype: default output array data type. Setting this option overrides + the default array data type specified when invoking the parent + function. + + Examples + -------- + > var dt = [ 'float64', 'float32', 'generic' ]; + > var f = {{alias}}( {{alias:@stdlib/random/base/exponential}}, dt, dt[0] ); + > var fcn = f(); + > var x = fcn( 5, 2.0 ) + + > x = fcn( 5, 2.0, { 'dtype': 'float32' } ) + + + See Also + -------- + diff --git a/array/tools/unary-factory/examples/index.js b/array/tools/unary-factory/examples/index.js new file mode 100644 index 00000000..69d5e229 --- /dev/null +++ b/array/tools/unary-factory/examples/index.js @@ -0,0 +1,47 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var exponential = require( './../../../../base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var unaryFactory = require( './../lib' ); + +var dt = dtypes( 'real_floating_point_and_generic' ); + +var factory = unaryFactory( exponential, dt, 'float64' ); +// returns + +var random = factory(); +// returns + +var x = random( 10, 2.0 ); +console.log( x ); +// => + +x = random( 10, 2.0, { + 'dtype': 'float32' +}); +console.log( x ); +// => + +x = random( 10, 2.0, { + 'dtype': 'generic' +}); +console.log( x ); +// => [...] diff --git a/array/tools/unary-factory/lib/index.js b/array/tools/unary-factory/lib/index.js new file mode 100644 index 00000000..5e9adea5 --- /dev/null +++ b/array/tools/unary-factory/lib/index.js @@ -0,0 +1,49 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Create a factory function for generating pseudorandom values drawn from a unary PRNG. +* +* @module @stdlib/random/array/tools/unary-factory +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* var unaryFactory = require( '@stdlib/random/array/tools/unary-factory' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* +* var factory = unaryFactory( exponential, dtypes, 'float64' ); +* // returns +* +* var random = factory(); +* // returns +* +* var x = random( 10, 0.2 ); +* // returns +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/array/tools/unary-factory/lib/main.js b/array/tools/unary-factory/lib/main.js new file mode 100644 index 00000000..42ef7ad6 --- /dev/null +++ b/array/tools/unary-factory/lib/main.js @@ -0,0 +1,313 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' ); +var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' ); +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; +var isFunction = require( '@stdlib/assert/is-function' ); +var isMethodIn = require( '@stdlib/assert/is-method-in' ); +var isPlainObject = require( '@stdlib/assert/is-plain-object' ); +var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var contains = require( '@stdlib/array/base/assert/contains' ).factory; +var constantFunction = require( '@stdlib/utils/constant-function' ); +var noop = require( '@stdlib/utils/noop' ); +var UnaryRandom = require( './../../../../array/tools/unary' ); +var NullaryRandom = require( './../../../../array/tools/nullary' ); +var format = require( '@stdlib/string/format' ); + + +// MAIN // + +/** +* Returns a factory function for generating pseudorandom values drawn from a unary PRNG. +* +* @param {Function} prng - unary pseudorandom value generator +* @param {Function} prng.factory - method which returns a new unary pseudorandom value generator +* @param {StringArray} dtypes - list of supported output array data types +* @param {string} dtype - default output array data type +* @throws {TypeError} first argument must be a function +* @throws {TypeError} first argument must have a `factory` method +* @throws {TypeError} second argument must be an array of strings +* @throws {TypeError} third argument must be a supported output array data type +* @returns {Function} function which returns a function for creating arrays +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* +* var factory = createFactory( exponential, dtypes, 'float64' ); +* // returns +* +* var random = factory(); +* // returns +* +* var x = random( 10, 0.2 ); +* // returns +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* +* var factory = createFactory( exponential, dtypes, 'float64' ); +* // returns +* +* var random = factory(); +* // returns +* +* var x = random( 10, 0.2, { +* 'dtype': 'float32' +* }); +* // returns +*/ +function createFactory( prng, dtypes, dtype ) { + var isValidDataType; + if ( !isFunction( prng ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) ); + } + if ( !isMethodIn( prng, 'factory' ) ) { + throw new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) ); + } + // TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings + if ( !isStringArray( dtypes ) ) { + throw new TypeError( format( 'invalid argument. Second argument must an array of strings. Value: `%s`.', dtypes ) ); + } + // Require that the default output array data type be a member of the list of supported output array data types... + if ( !contains( dtypes, dtype ) ) { + throw new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) ); + } + isValidDataType = contains( dtypes ); + return factory; + + /** + * Returns a function for generating pseudorandom values drawn from a PRNG. + * + * @private + * @param {*} [param1] - PRNG parameter + * @param {Options} [options] - function options + * @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers + * @param {*} [options.seed] - pseudorandom value generator seed + * @param {*} [options.state] - pseudorandom value generator state + * @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state + * @param {string} [options.dtype] - default output array data type + * @throws {TypeError} options argument must be an object + * @throws {TypeError} must provide valid options + * @throws {Error} must provide a valid state + * @returns {Function} function for creating arrays + */ + function factory() { + var Random; + var random; + var param1; + var assign; + var nargs; + var base; + var opts; + var rand; + var dt; + + nargs = arguments.length; + if ( nargs < 1 ) { // e.g., factory() + opts = {}; + base = prng; + rand = rand1; + } else if ( nargs > 1 ) { // e.g., factory( param1, {} ) + param1 = arguments[ 0 ]; + opts = arguments[ 1 ]; + base = prng.factory( param1, opts ); + rand = rand2; + } else if ( isPlainObject( arguments[ 0 ] ) ) { // e.g., factory( {} ) + opts = arguments[ 0 ]; + base = prng.factory( opts ); + rand = rand1; + } else { // e.g., factory( param1 ) + param1 = arguments[ 0 ]; + opts = {}; + base = prng.factory( param1 ); + rand = rand2; + } + if ( hasOwnProp( opts, 'dtype' ) ) { + dt = opts.dtype; + if ( !isValidDataType( dt ) ) { + throw new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'dtype', dtypes.join( '", "' ), dt ) ); + } + } else { + dt = dtype; + } + if ( rand === rand1 ) { + assign = assign1; + Random = UnaryRandom; + } else { + assign = assign2; + Random = NullaryRandom; + } + random = new Random( base, dtypes, dt ); + if ( opts && opts.prng ) { + setReadOnly( rand, 'seed', null ); + setReadOnly( rand, 'seedLength', null ); + setReadWriteAccessor( rand, 'state', constantFunction( null ), noop ); + setReadOnly( rand, 'stateLength', null ); + setReadOnly( rand, 'byteLength', null ); + } else { + setReadOnlyAccessor( rand, 'seed', getSeed ); + setReadOnlyAccessor( rand, 'seedLength', getSeedLength ); + setReadWriteAccessor( rand, 'state', getState, setState ); + setReadOnlyAccessor( rand, 'stateLength', getStateLength ); + setReadOnlyAccessor( rand, 'byteLength', getStateSize ); + } + setReadOnly( rand, 'PRNG', base.PRNG ); + setReadOnly( rand, 'assign', assign ); + return rand; + + /** + * Returns an array of pseudorandom values drawn from a PRNG. + * + * @private + * @param {NonNegativeInteger} len - output array length + * @param {*} param1 - PRNG parameter + * @param {Options} [options] - function options + * @param {string} [options.dtype] - output array data type + * @throws {TypeError} first argument must be a nonnegative integer + * @throws {TypeError} options argument must be an object + * @throws {TypeError} must provide valid options + * @returns {Collection} output array + */ + function rand1( len, param1, options ) { + if ( arguments.length < 3 ) { + return random.generate( len, param1 ); + } + return random.generate( len, param1, options ); + } + + /** + * Returns an array of pseudorandom values drawn from a PRNG. + * + * @private + * @param {NonNegativeInteger} len - output array length + * @param {Options} [options] - function options + * @param {string} [options.dtype] - output array data type + * @throws {TypeError} first argument must be a nonnegative integer + * @throws {TypeError} options argument must be an object + * @throws {TypeError} must provide valid options + * @returns {Collection} output array + */ + function rand2( len, options ) { + if ( arguments.length < 2 ) { + return random.generate( len ); + } + return random.generate( len, options ); + } + + /** + * Fills an array with pseudorandom values drawn from a PRNG. + * + * @private + * @param {*} param1 - PRNG parameter + * @param {Collection} out - output array + * @throws {TypeError} second argument must be a collection + * @returns {Collection} output array + */ + function assign1( param1, out ) { + return random.assign( param1, out ); + } + + /** + * Fills an array with pseudorandom values drawn from a PRNG. + * + * @private + * @param {Collection} out - output array + * @throws {TypeError} first argument must be a collection + * @returns {Collection} output array + */ + function assign2( out ) { + return random.assign( out ); + } + + /** + * Returns the PRNG seed. + * + * @private + * @returns {*} seed + */ + function getSeed() { + return rand.PRNG.seed; + } + + /** + * Returns the PRNG seed length. + * + * @private + * @returns {PositiveInteger} seed length + */ + function getSeedLength() { + return rand.PRNG.seedLength; + } + + /** + * Returns the PRNG state length. + * + * @private + * @returns {PositiveInteger} state length + */ + function getStateLength() { + return rand.PRNG.stateLength; + } + + /** + * Returns the PRNG state size (in bytes). + * + * @private + * @returns {PositiveInteger} state size (in bytes) + */ + function getStateSize() { + return rand.PRNG.byteLength; + } + + /** + * Returns the current pseudorandom number generator state. + * + * @private + * @returns {*} current state + */ + function getState() { + return rand.PRNG.state; + } + + /** + * Sets the pseudorandom number generator state. + * + * @private + * @param {*} s - generator state + * @throws {Error} must provide a valid state + */ + function setState( s ) { + rand.PRNG.state = s; + } + } +} + + +// EXPORTS // + +module.exports = createFactory; diff --git a/array/tools/unary-factory/package.json b/array/tools/unary-factory/package.json new file mode 100644 index 00000000..6949a4a2 --- /dev/null +++ b/array/tools/unary-factory/package.json @@ -0,0 +1,72 @@ +{ + "name": "@stdlib/random/array/tools/unary-factory", + "version": "0.0.0", + "description": "Create a factory function for generating pseudorandom values drawn from a unary PRNG.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "statistics", + "stats", + "tools", + "prng", + "rng", + "pseudorandom", + "random", + "rand", + "generator", + "factory", + "function", + "func", + "fcn", + "vector", + "array" + ] +} diff --git a/array/tools/unary-factory/test/test.js b/array/tools/unary-factory/test/test.js new file mode 100644 index 00000000..f044e4a7 --- /dev/null +++ b/array/tools/unary-factory/test/test.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var createFactory = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof createFactory, 'function', 'main export is a function' ); + t.end(); +}); diff --git a/array/tools/unary/README.md b/array/tools/unary/README.md new file mode 100644 index 00000000..4eb28a75 --- /dev/null +++ b/array/tools/unary/README.md @@ -0,0 +1,180 @@ + + +# Unary + +> Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG. + +
+ +## Usage + +```javascript +var Random = require( '@stdlib/random/array/tools/unary' ); +``` + +#### Random( prng, dtypes, dtype ) + +Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; +var defaultDType = 'float64'; + +var random = new Random( exponential, dtypes, defaultDType ); +``` + +The constructor has the following parameters: + +- **prng**: unary pseudorandom value generator. +- **dtypes**: list of supported output data types. +- **dtype**: default output data type. + +#### Random.prototype.generate( len, param1\[, options] ) + +Returns an array filled with pseudorandom values drawn from a unary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; +var defaultDType = 'float64'; + +var random = new Random( exponential, dtypes, defaultDType ); + +var v = random.generate( 10, 2.0 ); +// returns +``` + +The method has the following parameters: + +- **len**: output array length. +- **param1**: PRNG parameter. +- **options**: function options. + +The method accepts the following options: + +- **dtype**: output array data type. Setting this option, overrides the default output array data type. + +By default, the method returns an array having the default output array data type. To override the default, set the `dtype` option. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; +var defaultDType = 'float64'; + +var random = new Random( exponential, dtypes, defaultDType ); + +var v = random.generate( 10, 2.0, { + 'dtype': 'float32' +}); +// returns +``` + +#### Random.prototype.assign( param1, out ) + +Fills an array with pseudorandom values drawn from a unary PRNG. + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var zeros = require( '@stdlib/array/zeros' ); + +var dtypes = [ 'float64', 'float32', 'generic' ]; +var defaultDType = 'float64'; + +var random = new Random( exponential, dtypes, defaultDType ); + +var out = zeros( 10, 'float64' ); +// returns + +var v = random.assign( 2.0, out ); +// returns + +var bool = ( v === out ); +// returns true +``` + +The method has the following parameters: + +- **param1**: PRNG parameter. +- **out**: output array. + +
+ + + +
+ +
+ + + +
+ +## Examples + + + +```javascript +var exponential = require( '@stdlib/random/base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var Random = require( '@stdlib/random/array/tools/unary' ); + +var dt = dtypes( 'real_floating_point' ); +dt.push( 'generic' ); + +var random = new Random( exponential, dt, 'float64' ); + +var x = random.generate( 10, 2.0 ); +// returns + +x = random.generate( 10, 2.0, { + 'dtype': 'float32' +}); +// returns + +x = random.generate( 10, 2.0, { + 'dtype': 'generic' +}); +// returns [...] +``` + +
+ + + + + + + + + + + + + + diff --git a/array/tools/unary/benchmark/benchmark.assign.js b/array/tools/unary/benchmark/benchmark.assign.js new file mode 100644 index 00000000..d5f348ae --- /dev/null +++ b/array/tools/unary/benchmark/benchmark.assign.js @@ -0,0 +1,105 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var exponential = require( './../../../../base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var zeros = require( '@stdlib/array/zeros' ); +var pkg = require( './../package.json' ).name; +var Random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var random; + var dt; + + dt = dtypes( 'real_floating_point' ); + random = new Random( exponential, dt, 'float64' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var out; + var o; + var i; + + out = zeros( len, 'float64' ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random.assign( 2.0, out ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':assign:len='+len, f ); + } +} + +main(); diff --git a/array/tools/unary/benchmark/benchmark.generate.js b/array/tools/unary/benchmark/benchmark.generate.js new file mode 100644 index 00000000..4b9d43b8 --- /dev/null +++ b/array/tools/unary/benchmark/benchmark.generate.js @@ -0,0 +1,101 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var exponential = require( './../../../../base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var pkg = require( './../package.json' ).name; +var Random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var random; + var dt; + + dt = dtypes( 'real_floating_point' ); + random = new Random( exponential, dt, 'float64' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random.generate( len, 2.0 ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':generate:len='+len, f ); + } +} + +main(); diff --git a/array/tools/unary/benchmark/benchmark.js b/array/tools/unary/benchmark/benchmark.js new file mode 100644 index 00000000..83564a81 --- /dev/null +++ b/array/tools/unary/benchmark/benchmark.js @@ -0,0 +1,93 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var exponential = require( './../../../../base/exponential' ); +var geometric = require( './../../../../base/geometric' ); +var pkg = require( './../package.json' ).name; +var Random = require( './../lib' ); + + +// MAIN // + +bench( pkg+'::new', function benchmark( b ) { + var values; + var dtypes; + var v; + var i; + + values = [ + exponential, + geometric + ]; + dtypes = [ + 'float64', + 'float32' + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + v = new Random( values[ i%values.length ], dtypes, 'float64' ); + if ( typeof v !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( !( v instanceof Random ) ) { + b.fail( 'should return an instance' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( pkg+'::no_new', function benchmark( b ) { + var values; + var dtypes; + var random; + var v; + var i; + + values = [ + exponential, + geometric + ]; + dtypes = [ + 'float64', + 'float32' + ]; + + random = Random; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + v = random( values[ i%values.length ], dtypes, 'float64' ); + if ( typeof v !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( !( v instanceof Random ) ) { + b.fail( 'should return an instance' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/array/tools/unary/docs/repl.txt b/array/tools/unary/docs/repl.txt new file mode 100644 index 00000000..340efd78 --- /dev/null +++ b/array/tools/unary/docs/repl.txt @@ -0,0 +1,88 @@ + +{{alias}}( prng, dtypes, dtype ) + Constructor for creating arrays filled with pseudorandom values drawn from + a unary PRNG. + + Parameters + ---------- + prng: Function + Unary pseudorandom value generator. + + dtypes: Array + List of supported output array data types. + + dtype: string + Default output array data type. + + Returns + ------- + out: Object + Instance having methods for creating filled arrays. + + Examples + -------- + > var dt = [ 'float64', 'float32', 'generic' ]; + > var out = {{alias}}( {{alias:@stdlib/random/base/exponential}}, dt, 'float64' ); + + +{{alias}}.prototype.generate( len, param1[, options] ) + Returns an array filled with pseudorandom values drawn from a unary PRNG. + + Parameters + ---------- + len: integer + Output array length. + + param1: any + PRNG parameter. + + options: Object (optional) + Function options. + + options.dtype: string (optional) + Output array data type. Setting this option overrides the default output + array data type. + + Returns + ------- + out: Array|TypedArray + Output array. + + Examples + -------- + > var dt = [ 'float64', 'float32', 'generic' ]; + > var r = {{alias}}( {{alias:@stdlib/random/base/exponential}}, dt, 'float64' ); + > var v = r.generate( 5, 2.0 ) + + + +{{alias}}.prototype.assign( param1, out ) + Fills an array with pseudorandom values drawn from a unary PRNG. + + Parameters + ---------- + param1: any + PRNG parameter. + + out: Array|TypedArray|Object + Output array. + + Returns + ------- + out: Array|TypedArray|Object + Output array. + + Examples + -------- + > var dt = [ 'float64', 'float32', 'generic' ]; + > var r = {{alias}}( {{alias:@stdlib/random/base/exponential}}, dt, 'float64' ); + > var out = {{alias:@stdlib/array/zeros}}( 5, 'float64' ) + + > var v = r.assign( 2.0, out ) + + > var bool = ( out === v ) + true + + See Also + -------- + diff --git a/array/tools/unary/docs/types/index.d.ts b/array/tools/unary/docs/types/index.d.ts new file mode 100644 index 00000000..334f5bad --- /dev/null +++ b/array/tools/unary/docs/types/index.d.ts @@ -0,0 +1,199 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { DataType, ArrayLike, AccessorArrayLike } from '@stdlib/types/array'; +import { PRNG } from '@stdlib/types/random'; + +/** +* Output array. +*/ +type OutputArray = ArrayLike | AccessorArrayLike; + +/** +* Interface defining options. +*/ +interface Options { + /** + * Output array data type. + */ + dtype?: DataType; +} + +/** +* Interface for generating pseudorandom values drawn from a unary PRNG. +*/ +interface UnaryPRNG extends PRNG { + /** + * Returns a pseudorandom value. + * + * @param param1 - PRNG parameter + * @returns pseudorandom value + */ + ( param1: T ): U; +} + +/** +* Class for creating arrays filled with pseudorandom values drawn from a unary PRNG. +*/ +declare class RandomArray { + /** + * Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG. + * + * @param prng - unary pseudorandom value generator + * @param dtypes - list of supported output data types + * @param dtype - default output data type + * @returns instance + * + * @example + * var exponential = require( './../../../../../base/exponential' ); + * + * var dtypes = [ 'float64', 'float32', 'generic' ]; + * var defaultDType = 'float64'; + * + * var rand = new RandomArray( exponential, dtypes, defaultDType ); + * + * var v = rand.generate( 10, 2.0 ); + * // returns + */ + constructor( prng: UnaryPRNG, dtypes: ArrayLike, dtype: DataType ); + + /** + * Returns an array filled with pseudorandom values drawn from a unary PRNG. + * + * @param len - number of elements + * @param param1 - PRNG parameter + * @param options - function options + * @returns output array + * + * @example + * var exponential = require( './../../../../../base/exponential' ); + * + * var dtypes = [ 'float64', 'float32', 'generic' ]; + * var defaultDType = 'float64'; + * + * var rand = new RandomArray( exponential, dtypes, defaultDType ); + * + * var v = rand.generate( 10, 2.0 ); + * // returns + */ + generate( len: number, param1: T, options?: Options ): OutputArray; + + /** + * Fills an array with pseudorandom values drawn from a unary PRNG. + * + * @param param1 - PRNG parameter + * @param out - output array + * @returns output array + * + * @example + * var exponential = require( './../../../../../base/exponential' ); + * var zeros = require( '@stdlib/array/zeros' ); + * + * var dtypes = [ 'float64', 'float32', 'generic' ]; + * var defaultDType = 'float64'; + * + * var rand = new RandomArray( exponential, dtypes, defaultDType ); + * + * var out = zeros( 10, 'float64' ); + * // returns + * + * var v = rand.assign( 2.0, out ); + * // returns + * + * var bool = ( v === out ); + * // returns true + */ + assign( param1: T, out: OutputArray ): OutputArray; +} + +/** +* Interface defining a constructor which is both "newable" and "callable". +*/ +interface RandomArrayConstructor { + /** + * Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG. + * + * @param prng - unary pseudorandom value generator + * @param dtypes - list of supported output data types + * @param dtype - default output data type + * @returns instance + * + * @example + * var exponential = require( './../../../../../base/exponential' ); + * + * var dtypes = [ 'float64', 'float32', 'generic' ]; + * var defaultDType = 'float64'; + * + * var rand = new RandomArray( exponential, dtypes, defaultDType ); + * + * var v = rand.generate( 10, 2.0 ); + * // returns + */ + new( prng: UnaryPRNG, dtypes: ArrayLike, dtype: DataType ): RandomArray; + + /** + * Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG. + * + * @param prng - unary pseudorandom value generator + * @param dtypes - list of supported output data types + * @param dtype - default output data type + * @returns instance + * + * @example + * var exponential = require( './../../../../../base/exponential' ); + * + * var dtypes = [ 'float64', 'float32', 'generic' ]; + * var defaultDType = 'float64'; + * + * var rand = new RandomArray( exponential, dtypes, defaultDType ); + * + * var v = rand.generate( 10, 2.0 ); + * // returns + */ + ( prng: UnaryPRNG, dtypes: ArrayLike, dtype: DataType ): RandomArray; +} + +/** +* Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG. +* +* @param prng - unary pseudorandom value generator +* @param dtypes - list of supported output data types +* @param dtype - default output data type +* @returns instance +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* var defaultDType = 'float64'; +* +* var rand = new RandomArray( exponential, dtypes, defaultDType ); +* +* var v = rand.generate( 10, 2.0 ); +* // returns +*/ +declare var ctor: RandomArrayConstructor; + + +// EXPORTS // + +export = ctor; diff --git a/array/tools/unary/docs/types/test.ts b/array/tools/unary/docs/types/test.ts new file mode 100644 index 00000000..73f3e0a0 --- /dev/null +++ b/array/tools/unary/docs/types/test.ts @@ -0,0 +1,248 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable @typescript-eslint/no-unused-expressions */ + +/// + +import { DataType } from '@stdlib/types/array'; +import exponential = require( './../../../../../base/exponential' ); +import zeros = require( '@stdlib/array/zeros' ); +import Random = require( './index' ); + + +// TESTS // + +// The function returns an instance for generating arrays of pseudorandom values... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + new Random( exponential, dtypes, dtypes[ 0 ] ); // $ExpectType RandomArray + + const random = Random; + random( exponential, dtypes, dtypes[ 0 ] ); // $ExpectType RandomArray +} + +// The compiler throws an error if the function is provided a first argument which is not a PRNG function... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + new Random( '5', dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( 5, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( true, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( false, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( null, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( void 0, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( 'abc', dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( {}, dtypes, dtypes[ 0 ] ); // $ExpectError + new Random( ( x: number ): number => x, dtypes, dtypes[ 0 ] ); // $ExpectError + + const random = Random; + random( '5', dtypes, dtypes[ 0 ] ); // $ExpectError + random( 5, dtypes, dtypes[ 0 ] ); // $ExpectError + random( true, dtypes, dtypes[ 0 ] ); // $ExpectError + random( false, dtypes, dtypes[ 0 ] ); // $ExpectError + random( null, dtypes, dtypes[ 0 ] ); // $ExpectError + random( void 0, dtypes, dtypes[ 0 ] ); // $ExpectError + random( 'abc', dtypes, dtypes[ 0 ] ); // $ExpectError + random( {}, dtypes, dtypes[ 0 ] ); // $ExpectError + random( ( x: number ): number => x, dtypes, dtypes[ 0 ] ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a list of data types... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + new Random( exponential, '5', dtypes[ 0 ] ); // $ExpectError + new Random( exponential, 5, dtypes[ 0 ] ); // $ExpectError + new Random( exponential, true, dtypes[ 0 ] ); // $ExpectError + new Random( exponential, false, dtypes[ 0 ] ); // $ExpectError + new Random( exponential, null, dtypes[ 0 ] ); // $ExpectError + new Random( exponential, void 0, dtypes[ 0 ] ); // $ExpectError + new Random( exponential, 'abc', dtypes[ 0 ] ); // $ExpectError + new Random( exponential, {}, dtypes[ 0 ] ); // $ExpectError + new Random( exponential, ( x: number ): number => x, dtypes[ 0 ] ); // $ExpectError + + const random = Random; + random( exponential, '5', dtypes[ 0 ] ); // $ExpectError + random( exponential, 5, dtypes[ 0 ] ); // $ExpectError + random( exponential, true, dtypes[ 0 ] ); // $ExpectError + random( exponential, false, dtypes[ 0 ] ); // $ExpectError + random( exponential, null, dtypes[ 0 ] ); // $ExpectError + random( exponential, void 0, dtypes[ 0 ] ); // $ExpectError + random( exponential, 'abc', dtypes[ 0 ] ); // $ExpectError + random( exponential, {}, dtypes[ 0 ] ); // $ExpectError + random( exponential, ( x: number ): number => x, dtypes[ 0 ] ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a data type... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + new Random( exponential, dtypes, '5' ); // $ExpectError + new Random( exponential, dtypes, 5 ); // $ExpectError + new Random( exponential, dtypes, true ); // $ExpectError + new Random( exponential, dtypes, false ); // $ExpectError + new Random( exponential, dtypes, null ); // $ExpectError + new Random( exponential, dtypes, void 0 ); // $ExpectError + new Random( exponential, dtypes, 'abc' ); // $ExpectError + new Random( exponential, dtypes, {} ); // $ExpectError + new Random( exponential, dtypes, ( x: number ): number => x ); // $ExpectError + + const random = Random; + random( exponential, dtypes, '5' ); // $ExpectError + random( exponential, dtypes, 5 ); // $ExpectError + random( exponential, dtypes, true ); // $ExpectError + random( exponential, dtypes, false ); // $ExpectError + random( exponential, dtypes, null ); // $ExpectError + random( exponential, dtypes, void 0 ); // $ExpectError + random( exponential, dtypes, 'abc' ); // $ExpectError + random( exponential, dtypes, {} ); // $ExpectError + random( exponential, dtypes, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + new Random(); // $ExpectError + new Random( exponential ); // $ExpectError + new Random( exponential, dtypes ); // $ExpectError + new Random( exponential, dtypes, dtypes[ 0 ], {} ); // $ExpectError + + const random = Random; + random(); // $ExpectError + random( exponential ); // $ExpectError + random( exponential, dtypes ); // $ExpectError + random( exponential, dtypes, dtypes[ 0 ], {} ); // $ExpectError +} + +// The function returns an instance having a `generate` method which returns an array... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential, dtypes, dtypes[ 0 ] ); + r1.generate( 10, 2.0 ); // $ExpectType OutputArray + r1.generate( 10, 2.0, {} ); // $ExpectType OutputArray + + const random = Random; + const r2 = random( exponential, dtypes, dtypes[ 0 ] ); + r2.generate( 10, 2.0 ); // $ExpectType OutputArray + r2.generate( 10, 2.0, {} ); // $ExpectType OutputArray +} + +// The compiler throws an error if the `generate` method is provided a first argument which is not a number... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential, dtypes, dtypes[ 0 ] ); + r1.generate( '5', 2.0 ); // $ExpectError + r1.generate( true, 2.0 ); // $ExpectError + r1.generate( false, 2.0 ); // $ExpectError + r1.generate( null, 2.0 ); // $ExpectError + r1.generate( void 0, 2.0 ); // $ExpectError + r1.generate( [], 2.0 ); // $ExpectError + r1.generate( {}, 2.0 ); // $ExpectError + r1.generate( ( x: number ): number => x, 2.0 ); // $ExpectError + + r1.generate( '5', 2.0, {} ); // $ExpectError + r1.generate( true, 2.0, {} ); // $ExpectError + r1.generate( false, 2.0, {} ); // $ExpectError + r1.generate( null, 2.0, {} ); // $ExpectError + r1.generate( void 0, 2.0, {} ); // $ExpectError + r1.generate( [], 2.0, {} ); // $ExpectError + r1.generate( {}, 2.0, {} ); // $ExpectError + r1.generate( ( x: number ): number => x, 2.0, {} ); // $ExpectError +} + +// The compiler throws an error if the `generate` method is provided a third argument which is not an object... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential, dtypes, dtypes[ 0 ] ); + r1.generate( 10, 2.0, '5' ); // $ExpectError + r1.generate( 10, 2.0, true ); // $ExpectError + r1.generate( 10, 2.0, false ); // $ExpectError + r1.generate( 10, 2.0, null ); // $ExpectError + r1.generate( 10, 2.0, [] ); // $ExpectError + r1.generate( 10, 2.0, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `generate` method is provided an invalid `dtype` option... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential, dtypes, dtypes[ 0 ] ); + r1.generate( 10, 2.0, { 'dtype': '5' } ); // $ExpectError + r1.generate( 10, 2.0, { 'dtype': 5 } ); // $ExpectError + r1.generate( 10, 2.0, { 'dtype': true } ); // $ExpectError + r1.generate( 10, 2.0, { 'dtype': false } ); // $ExpectError + r1.generate( 10, 2.0, { 'dtype': null } ); // $ExpectError + r1.generate( 10, 2.0, { 'dtype': [] } ); // $ExpectError + r1.generate( 10, 2.0, { 'dtype': {} } ); // $ExpectError + r1.generate( 10, 2.0, { 'dtype': ( x: number ): number => x } ); // $ExpectError +} + +// The compiler throws an error if the `generate` method is provided an unsupported number of arguments... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential, dtypes, dtypes[ 0 ] ); + r1.generate(); // $ExpectError + r1.generate( 10 ); // $ExpectError + r1.generate( 10, 2.0, {}, {} ); // $ExpectError +} + +// The function returns an instance having an `assign` method which returns an array... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + const x = zeros( 10, dtypes[ 0 ] ); + + const r1 = new Random( exponential, dtypes, dtypes[ 0 ] ); + r1.assign( 2.0, x ); // $ExpectType OutputArray + + const random = Random; + const r2 = random( exponential, dtypes, dtypes[ 0 ] ); + r2.assign( 2.0, x ); // $ExpectType OutputArray +} + +// The compiler throws an error if the `assign` method is provided a second argument which is not an array-like object... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + + const r1 = new Random( exponential, dtypes, dtypes[ 0 ] ); + r1.assign( 2.0, '5' ); // $ExpectError + r1.assign( 2.0, 5 ); // $ExpectError + r1.assign( 2.0, true ); // $ExpectError + r1.assign( 2.0, false ); // $ExpectError + r1.assign( 2.0, null ); // $ExpectError + r1.assign( 2.0, void 0 ); // $ExpectError + r1.assign( 2.0, {} ); // $ExpectError + r1.assign( 2.0, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... +{ + const dtypes: Array = [ 'float64', 'float32' ]; + const x = zeros( 10, dtypes[ 0 ] ); + + const r1 = new Random( exponential, dtypes, dtypes[ 0 ] ); + r1.assign(); // $ExpectError + r1.assign( 2.0 ); // $ExpectError + r1.assign( 2.0, x, {} ); // $ExpectError +} diff --git a/array/tools/unary/examples/index.js b/array/tools/unary/examples/index.js new file mode 100644 index 00000000..c928ce95 --- /dev/null +++ b/array/tools/unary/examples/index.js @@ -0,0 +1,44 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var exponential = require( './../../../../base/exponential' ); +var dtypes = require( '@stdlib/array/dtypes' ); +var Random = require( './../lib' ); + +var dt = dtypes( 'real_floating_point' ); +dt.push( 'generic' ); + +var random = new Random( exponential, dt, 'float64' ); + +var x = random.generate( 10, 2.0 ); +console.log( x ); +// => + +x = random.generate( 10, 2.0, { + 'dtype': 'float32' +}); +console.log( x ); +// => + +x = random.generate( 10, 2.0, { + 'dtype': 'generic' +}); +console.log( x ); +// => [...] diff --git a/array/tools/unary/lib/index.js b/array/tools/unary/lib/index.js new file mode 100644 index 00000000..c4292355 --- /dev/null +++ b/array/tools/unary/lib/index.js @@ -0,0 +1,46 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG. +* +* @module @stdlib/random/array/tools/unary +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* var Random = require( '@stdlib/random/array/tools/unary' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* var defaultDType = 'float64'; +* +* var rand = new Random( exponential, dtypes, defaultDType ); +* +* var v = rand.generate( 10, 2.0 ); +* // returns +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/array/tools/unary/lib/main.js b/array/tools/unary/lib/main.js new file mode 100644 index 00000000..e4f37105 --- /dev/null +++ b/array/tools/unary/lib/main.js @@ -0,0 +1,190 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-restricted-syntax, no-invalid-this */ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive; +var isFunction = require( '@stdlib/assert/is-function' ); +var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives; +var isCollection = require( '@stdlib/assert/is-collection' ); +var contains = require( '@stdlib/array/base/assert/contains' ); +var filledBy = require( '@stdlib/array/base/filled-by' ); +var unary = require( '@stdlib/strided/base/unary' ); +var ctors = require( '@stdlib/array/ctors' ); +var format = require( '@stdlib/string/format' ); +var validate = require( './validate.js' ); + + +// MAIN // + +/** +* Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG. +* +* @constructor +* @param {Function} prng - unary pseudorandom value generator +* @param {StringArray} dtypes - list of supported output data types +* @param {string} dtype - default output data type +* @throws {TypeError} first argument must be a function +* @throws {TypeError} second argument must be an array of strings +* @throws {TypeError} third argument must be a supported data type +* @returns {Random} instance +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* var defaultDType = 'float64'; +* +* var rand = new Random( exponential, dtypes, defaultDType ); +* +* var v = rand.generate( 10, 2.0 ); +* // returns +*/ +function Random( prng, dtypes, dtype ) { + if ( !( this instanceof Random ) ) { + return new Random( prng, dtypes, dtype ); + } + if ( !isFunction( prng ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) ); + } + // TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings + if ( !isStringArray( dtypes ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) ); + } + // Require that the default output array data type be a member of the list of supported output array data types... + if ( !contains( dtypes, dtype ) ) { + throw new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) ); + } + this._prng = prng; + this._dtypes = dtypes; + this._dtype = dtype; + return this; +} + +/** +* Returns an array filled with pseudorandom values drawn from a unary PRNG. +* +* @name generate +* @memberof Random.prototype +* @type {Function} +* @param {NonNegativeInteger} len - number of elements +* @param {*} param1 - PRNG parameter +* @param {Options} [options] - function options +* @param {string} [options.dtype] - array data type +* @throws {TypeError} first argument must be a nonnegative integer +* @throws {TypeError} options argument must be an object +* @throws {TypeError} must provide valid options +* @returns {Collection} output array +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* var defaultDType = 'float64'; +* +* var rand = new Random( exponential, dtypes, defaultDType ); +* +* var v = rand.generate( 10, 2.0 ); +* // returns +*/ +setReadOnly( Random.prototype, 'generate', function generate( len, param1, options ) { + var ctor; + var opts; + var prng; + var out; + var err; + var dt; + if ( !isNonNegativeInteger( len ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) ); + } + opts = {}; + if ( arguments.length > 2 ) { + err = validate( opts, this._dtypes, options ); + if ( err ) { + throw err; + } + } + // NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array). + prng = this._prng; + dt = opts.dtype || this._dtype; + if ( dt === 'generic' ) { + return filledBy( len, wrapper ); + } + ctor = ctors( dt ); + out = new ctor( len ); + unary( [ [ param1 ], out ], [ len ], [ 0, 1 ], prng ); + return out; + + /** + * Applies parameters to a pseudorandom value generator function. + * + * @private + * @returns {*} pseudorandom value + */ + function wrapper() { + return prng( param1 ); + } +}); + +/** +* Fills an array with pseudorandom values drawn from a unary PRNG. +* +* @name assign +* @memberof Random.prototype +* @type {Function} +* @param {*} param1 - PRNG parameter +* @param {Collection} out - output array +* @throws {TypeError} second argument must be a collection +* @returns {Collection} output array +* +* @example +* var exponential = require( '@stdlib/random/base/exponential' ); +* var zeros = require( '@stdlib/array/zeros' ); +* +* var dtypes = [ 'float64', 'float32', 'generic' ]; +* var defaultDType = 'float64'; +* +* var rand = new Random( exponential, dtypes, defaultDType ); +* +* var out = zeros( 10, 'float64' ); +* // returns +* +* var v = rand.assign( 2.0, out ); +* // returns +* +* var bool = ( v === out ); +* // returns true +*/ +setReadOnly( Random.prototype, 'assign', function assign( param1, out ) { + if ( !isCollection( out ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', out ) ); + } + // NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when filling small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array). + unary( [ [ param1 ], out ], [ out.length ], [ 0, 1 ], this._prng ); + return out; +}); + + +// EXPORTS // + +module.exports = Random; diff --git a/array/exponential/lib/validate.js b/array/tools/unary/lib/validate.js similarity index 79% rename from array/exponential/lib/validate.js rename to array/tools/unary/lib/validate.js index a31ee6b6..10d7d8be 100644 --- a/array/exponential/lib/validate.js +++ b/array/tools/unary/lib/validate.js @@ -20,18 +20,12 @@ // MODULES // -var dtypes = require( '@stdlib/array/typed-real-float-dtypes' ); var isObject = require( '@stdlib/assert/is-plain-object' ); var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var contains = require( '@stdlib/array/base/assert/contains' ); var format = require( '@stdlib/string/format' ); -// VARIABLES // - -var DTYPES = dtypes(); -DTYPES.push( 'generic' ); - - // MAIN // /** @@ -39,28 +33,30 @@ DTYPES.push( 'generic' ); * * @private * @param {Object} opts - destination object +* @param {Array} dtypes - list of supported output data types * @param {Options} options - function options * @param {string} [options.dtype] - output array data type * @returns {(Error|null)} null or an error object * * @example * var opts = {}; +* var dtypes = [ 'float64', 'float32', 'generic' ]; * var options = { * 'dtype': 'float64' * }; -* var err = validate( opts, options ); +* var err = validate( opts, dtypes, options ); * if ( err ) { * throw err; * } */ -function validate( opts, options ) { +function validate( opts, dtypes, options ) { if ( !isObject( options ) ) { return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); } if ( hasOwnProp( options, 'dtype' ) ) { opts.dtype = options.dtype; - if ( DTYPES.indexOf( opts.dtype ) < 0 ) { - return new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'dtype', DTYPES.join( '", "' ), opts.dtype ) ); + if ( !contains( dtypes, opts.dtype ) ) { + return new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'dtype', dtypes.join( '", "' ), opts.dtype ) ); } } return null; diff --git a/array/tools/unary/package.json b/array/tools/unary/package.json new file mode 100644 index 00000000..ba23acb7 --- /dev/null +++ b/array/tools/unary/package.json @@ -0,0 +1,70 @@ +{ + "name": "@stdlib/random/array/tools/unary", + "version": "0.0.0", + "description": "Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "statistics", + "stats", + "tools", + "prng", + "rng", + "pseudorandom", + "random", + "rand", + "generator", + "seed", + "seedable", + "array", + "vector" + ] +} diff --git a/array/tools/unary/test/test.js b/array/tools/unary/test/test.js new file mode 100644 index 00000000..fedf52b6 --- /dev/null +++ b/array/tools/unary/test/test.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2023 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Random = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof Random, 'function', 'main export is a function' ); + t.end(); +}); diff --git a/dist/index.js b/dist/index.js index ab6bd59c..ced3ed32 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -"use strict";var s=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var el=s(function(wBe,sp){"use strict";var nQ=require("@stdlib/constants/uint32/max"),aQ=require("@stdlib/math/base/special/floor"),sQ=nQ-1;function uQ(){var r=aQ(1+sQ*Math.random());return r>>>0}sp.exports=uQ});var ol=s(function(SBe,pp){"use strict";var jr=require("@stdlib/utils/define-nonenumerable-read-only-property"),st=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),up=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rl=require("@stdlib/assert/has-own-property"),oQ=require("@stdlib/assert/is-plain-object"),gQ=require("@stdlib/assert/is-collection"),op=require("@stdlib/assert/is-uint32array"),vQ=require("@stdlib/assert/is-boolean").isPrimitive,gp=require("@stdlib/assert/is-positive-integer").isPrimitive,cp=require("@stdlib/constants/float64/max-safe-integer"),mp=require("@stdlib/constants/uint32/max"),z=require("@stdlib/array/uint32"),fQ=require("@stdlib/math/base/special/max"),ul=require("@stdlib/math/base/ops/umul"),ea=require("@stdlib/blas/base/gcopy"),dQ=require("@stdlib/array/to-json"),J=require("@stdlib/string/format"),vp=el(),x=624,tl=397,fp=mp>>>0,lQ=19650218,il=2147483648,nl=2147483647,cQ=1812433253,mQ=1664525,hQ=1566083941,pQ=2636928640,yQ=4022730752,qQ=2567483615,al=[0,qQ>>>0],hp=1/(cp+1),bQ=67108864,wQ=2147483648,sl=1,SQ=cp*hp,yu=1,qu=3,ut=2,ot=x+3,k=x+5,ds=x+6;function dp(r,e){var i;return e?i="option":i="argument",r.length>>0,t=1;t>>0,i=(i^i>>>30)>>>0,r[t]=ul(i,cQ)+t>>>0;return r}function OQ(r,e,i,t){var n,a,u,o;for(a=1,u=0,o=fQ(e,t);o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=ul(n,mQ)>>>0,r[a]=(r[a]>>>0^n)+i[u]+u>>>0,a+=1,u+=1,a>=e&&(r[0]=r[e-1],a=1),u>=t&&(u=0);for(o=e-1;o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=ul(n,hQ)>>>0,r[a]=(r[a]>>>0^n)-a>>>0,a+=1,a>=e&&(r[0]=r[e-1],a=1);return r[0]=wQ,r}function NQ(r){var e,i,t,n;for(n=x-tl,i=0;i>>1^al[e&sl];for(t=x-1;i>>1^al[e&sl];return e=r[t]&il|r[0]&nl,r[t]=r[tl-1]^e>>>1^al[e&sl],r}function LQ(r){var e,i,t,n,a,u;if(t={},arguments.length){if(!oQ(r))throw new TypeError(J("invalid argument. Options argument must be an object. Value: `%s`.",r));if(rl(r,"copy")&&(t.copy=r.copy,!vQ(r.copy)))throw new TypeError(J("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(rl(r,"state")){if(i=r.state,t.state=!0,!op(i))throw new TypeError(J("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i));if(u=dp(i,!0),u)throw u;t.copy===!1?e=i:(e=new z(i.length),ea(i.length,i,1,e,1)),i=new z(e.buffer,e.byteOffset+(ut+1)*e.BYTES_PER_ELEMENT,x),n=new z(e.buffer,e.byteOffset+(k+1)*e.BYTES_PER_ELEMENT,i[k])}if(n===void 0)if(rl(r,"seed"))if(n=r.seed,t.seed=!0,gp(n)){if(n>fp)throw new RangeError(J("invalid option. `%s` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.","seed",n));n>>>=0}else{if(gQ(n)===!1||n.length<1)throw new TypeError(J("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.","seed",n));if(n.length===1){if(n=n[0],!gp(n))throw new TypeError(J("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.","seed",n));if(n>fp)throw new RangeError(J("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.","seed",n));n>>>=0}else a=n.length,e=new z(ds+a),e[0]=yu,e[1]=qu,e[ut]=x,e[ot]=1,e[ot+1]=x,e[k]=a,ea.ndarray(a,n,1,0,e,1,k+1),i=new z(e.buffer,e.byteOffset+(ut+1)*e.BYTES_PER_ELEMENT,x),n=new z(e.buffer,e.byteOffset+(k+1)*e.BYTES_PER_ELEMENT,a),i=lp(i,x,lQ),i=OQ(i,x,n,a)}else n=vp()>>>0}else n=vp()>>>0;return i===void 0&&(e=new z(ds+1),e[0]=yu,e[1]=qu,e[ut]=x,e[ot]=1,e[ot+1]=x,e[k]=1,e[k+1]=n,i=new z(e.buffer,e.byteOffset+(ut+1)*e.BYTES_PER_ELEMENT,x),n=new z(e.buffer,e.byteOffset+(k+1)*e.BYTES_PER_ELEMENT,1),i=lp(i,x,n)),jr(f,"NAME","mt19937"),st(f,"seed",o),st(f,"seedLength",g),up(f,"state",c,p),st(f,"stateLength",d),st(f,"byteLength",m),jr(f,"toJSON",y),jr(f,"MIN",0),jr(f,"MAX",mp),jr(f,"normalized",l),jr(l,"NAME",f.NAME),st(l,"seed",o),st(l,"seedLength",g),up(l,"state",c,p),st(l,"stateLength",d),st(l,"byteLength",m),jr(l,"toJSON",y),jr(l,"MIN",0),jr(l,"MAX",SQ),f;function o(){var v=e[k];return ea(v,n,1,new z(v),1)}function g(){return e[k]}function d(){return e.length}function m(){return e.byteLength}function c(){var v=e.length;return ea(v,e,1,new z(v),1)}function p(v){var h;if(!op(v))throw new TypeError(J("invalid argument. Must provide a Uint32Array. Value: `%s`.",v));if(h=dp(v,!1),h)throw h;t.copy===!1?t.state&&v.length===e.length?ea(v.length,v,1,e,1):(e=v,t.state=!0):(v.length!==e.length&&(e=new z(v.length)),ea(v.length,v,1,e,1)),i=new z(e.buffer,e.byteOffset+(ut+1)*e.BYTES_PER_ELEMENT,x),n=new z(e.buffer,e.byteOffset+(k+1)*e.BYTES_PER_ELEMENT,e[k])}function y(){var v={};return v.type="PRNG",v.name=f.NAME,v.state=dQ(e),v.params=[],v}function f(){var v,h;return h=e[ot+1],h>=x&&(i=NQ(i),h=0),v=i[h],e[ot+1]=h+1,v^=v>>>11,v^=v<<7&pQ,v^=v<<15&yQ,v^=v>>>18,v>>>0}function l(){var v=f()>>>5,h=f()>>>6;return(v*bQ+h)*hp}}pp.exports=LQ});var qp=s(function(OBe,yp){"use strict";var EQ=ol(),RQ=el(),PQ=EQ({seed:RQ()});yp.exports=PQ});var j=s(function(NBe,wp){"use strict";var _Q=require("@stdlib/utils/define-nonenumerable-read-only-property"),bp=qp(),TQ=ol();_Q(bp,"factory",TQ);wp.exports=bp});var Lp=s(function(LBe,Np){"use strict";var Sp=require("@stdlib/assert/is-number").isPrimitive,gl=require("@stdlib/string/format"),Op=require("@stdlib/assert/is-nan");function jQ(r,e){return!Sp(r)||Op(r)?new TypeError(gl("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!Sp(e)||Op(e)?new TypeError(gl("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(gl("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}Np.exports=jQ});var Rp=s(function(EBe,Ep){"use strict";var MQ=require("@stdlib/math/base/special/pow"),xQ=require("@stdlib/math/base/special/sin"),GQ=require("@stdlib/constants/float64/half-pi");function AQ(r,e,i){return e+MQ(xQ(GQ*r()),2)*(i-e)}Ep.exports=AQ});var vl=s(function(RBe,Ap){"use strict";var Mr=require("@stdlib/utils/define-nonenumerable-read-only-property"),bu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Pp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),_p=require("@stdlib/assert/is-plain-object"),Tp=require("@stdlib/assert/is-function"),jp=require("@stdlib/assert/has-own-property"),Mp=require("@stdlib/utils/constant-function"),VQ=require("@stdlib/utils/noop"),wu=j().factory,xp=require("@stdlib/math/base/assert/is-nan"),FQ=require("@stdlib/array/to-json"),Su=require("@stdlib/string/format"),WQ=Lp(),Gp=Rp();function IQ(){var r,e,i,t,n,a;if(arguments.length===0)e=wu();else if(arguments.length===1){if(r=arguments[0],!_p(r))throw new TypeError(Su("invalid argument. Options argument must be an object. Value: `%s`.",r));if(jp(r,"prng")){if(!Tp(r.prng))throw new TypeError(Su("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=wu(r)}else{if(n=arguments[0],a=arguments[1],t=WQ(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!_p(r))throw new TypeError(Su("invalid argument. Options argument must be an object. Value: `%s`.",r));if(jp(r,"prng")){if(!Tp(r.prng))throw new TypeError(Su("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=wu(r)}else e=wu()}return n===void 0?i=f:i=y,Mr(i,"NAME","arcsine"),r&&r.prng?(Mr(i,"seed",null),Mr(i,"seedLength",null),Pp(i,"state",Mp(null),VQ),Mr(i,"stateLength",null),Mr(i,"byteLength",null),Mr(i,"toJSON",Mp(null)),Mr(i,"PRNG",e)):(bu(i,"seed",u),bu(i,"seedLength",o),Pp(i,"state",m,c),bu(i,"stateLength",g),bu(i,"byteLength",d),Mr(i,"toJSON",p),Mr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function d(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function p(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=FQ(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return Gp(e,n,a)}function f(l,v){return xp(l)||xp(v)||l>=v?NaN:Gp(e,l,v)}}Ap.exports=IQ});var Fp=s(function(PBe,Vp){"use strict";var zQ=vl(),kQ=zQ();Vp.exports=kQ});var Ki=s(function(_Be,Ip){"use strict";var JQ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wp=Fp(),UQ=vl();JQ(Wp,"factory",UQ);Ip.exports=Wp});var zp=s(function(TBe,CQ){CQ.exports={dtype:"float64"}});var Up=s(function(jBe,Jp){"use strict";var BQ=require("@stdlib/array/typed-real-float-dtypes"),XQ=require("@stdlib/assert/is-plain-object"),DQ=require("@stdlib/assert/has-own-property"),kp=require("@stdlib/string/format"),fl=BQ();fl.push("generic");function YQ(r,e){return XQ(e)?DQ(e,"dtype")&&(r.dtype=e.dtype,fl.indexOf(r.dtype)<0)?new TypeError(kp('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",fl.join('", "'),r.dtype)):null:new TypeError(kp("invalid argument. Options argument must be an object. Value: `%s`.",e))}Jp.exports=YQ});var dl=s(function(MBe,Hp){"use strict";var Cp=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ls=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ou=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Bp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),HQ=require("@stdlib/utils/constant-function"),ZQ=require("@stdlib/utils/noop"),Nu=Ki(),Xp=require("@stdlib/array/typed-real-float-ctors"),Dp=require("@stdlib/array/base/filled-by"),QQ=require("@stdlib/strided/base/nullary"),$Q=require("@stdlib/strided/base/binary"),Yp=require("@stdlib/string/format"),KQ=zp(),Lu=Up();function e$(){var r,e,i,t,n,a;if(i={dtype:KQ.dtype},e=arguments.length,e===0)n=Nu,t=o;else if(e===1){if(r=arguments[0],n=Nu.factory(r),a=Lu(i,r),a)throw a;t=o}else if(e===2)n=Nu.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=Nu.factory(arguments[0],arguments[1],r),a=Lu(i,r),a)throw a;t=u}return r&&r.prng?(ls(t,"seed",null),ls(t,"seedLength",null),Bp(t,"state",HQ(null),ZQ),ls(t,"stateLength",null),ls(t,"byteLength",null)):(Ou(t,"seed",g),Ou(t,"seedLength",d),Bp(t,"state",p,y),Ou(t,"stateLength",m),Ou(t,"byteLength",c)),ls(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!Cp(f))throw new TypeError(Yp("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=Lu(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?Dp(f,n):(v=Xp(b),h=new v(f),QQ([h],[f],[1],n),h)}function o(f,l,v,h){var q,b,w,S,O;if(!Cp(f))throw new TypeError(Yp("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(O={},arguments.length>3&&(w=Lu(O,h),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return Dp(f,M);return q=Xp(S),b=new q(f),$Q([[l],[v],b],[f],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}Hp.exports=e$});var Qp=s(function(xBe,Zp){"use strict";var r$=dl(),t$=r$();Zp.exports=t$});var ey=s(function(GBe,Kp){"use strict";var i$=require("@stdlib/utils/define-nonenumerable-read-only-property"),$p=Qp(),n$=dl();i$($p,"factory",n$);Kp.exports=$p});var ny=s(function(ABe,iy){"use strict";var a$=require("@stdlib/math/base/special/sqrt"),ry=require("@stdlib/math/base/special/exp"),s$=require("@stdlib/math/base/special/ln"),ty=.00991256303526217;function u$(r,e){var i,t,n;for(t=ry(-.5*e*e),i=[],i.push(ty/t),i.push(e),n=2;n=0&&d<=1&&(g=r(),n=ml(u,4),m=8*i-12,m=1-n/m,g<=m?t=!1:(m+=.5*ml(n/(8*i-8),2),g=Ty(g)&&(t=!1))));return d}jy.exports=A$});var Gy=s(function(BBe,xy){"use strict";var V$=require("@stdlib/math/base/special/pow"),Pu=require("@stdlib/math/base/special/ln");function F$(r,e,i,t){var n,a,u,o,g,d,m,c,p,y,f;for(o=i-1,g=t-1,d=o+g,m=d*Pu(d),u=o/d,n=.5/V$(d,.5),a=!0;a===!0;)c=e(),y=u+c*n,y>=0&&y<=1&&(p=r(),f=o*Pu(y/o),f+=g*Pu((1-y)/g),f+=m+.5*c*c,f>=Pu(p)&&(a=!1));return y}xy.exports=F$});var Fy=s(function(XBe,Vy){"use strict";var hl=require("@stdlib/math/base/special/exp"),Ay=require("@stdlib/math/base/special/pow"),pl=require("@stdlib/math/base/special/ln");function W$(r,e,i){for(var t,n,a,u,o,g,d;;)if(u=r(),o=r(),g=Ay(u,1/e),d=Ay(o,1/i),a=g+d,a<=1)return a>0?g/a:(t=pl(u)/e,n=pl(o)/i,t>n?(n-=t,t=0):(t-=n,n=0),hl(t-pl(hl(t)+hl(n))))}Vy.exports=W$});var zy=s(function(DBe,Iy){"use strict";var Wy=_y(),I$=My(),z$=Gy(),k$=Fy();function J$(r,e,i,t){var n,a;return i===t&&i>1.5?I$(r,e,i):i>1&&t>1?z$(r,e,i,t):i<1&&t<1?k$(r,i,t):(n=Wy(r,e,i),a=Wy(r,e,t),n/(n+a))}Iy.exports=J$});var wl=s(function(YBe,Zy){"use strict";var xr=require("@stdlib/utils/define-nonenumerable-read-only-property"),_u=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ky=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Jy=require("@stdlib/assert/is-plain-object"),Uy=require("@stdlib/assert/is-boolean").isPrimitive,Cy=require("@stdlib/assert/is-function"),ra=require("@stdlib/assert/has-own-property"),By=require("@stdlib/utils/constant-function"),U$=require("@stdlib/utils/noop"),Xy=Y().factory,Tu=j().factory,Dy=require("@stdlib/math/base/assert/is-nan"),yl=require("@stdlib/blas/base/gcopy"),ql=require("@stdlib/array/uint32"),bl=require("@stdlib/assert/is-uint32array"),Yy=require("@stdlib/object/assign"),C$=require("@stdlib/array/to-json"),Gr=require("@stdlib/string/format"),B$=Ny(),Hy=zy();function X$(){var r,e,i,t,n,a,u,o,g;if(o=!0,arguments.length===0)n={copy:!1},a=Tu(n);else if(arguments.length===1){if(n=arguments[0],!Jy(n))throw new TypeError(Gr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(ra(n,"copy")&&!Uy(n.copy))throw new TypeError(Gr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(ra(n,"prng")){if(!Cy(n.prng))throw new TypeError(Gr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(ra(n,"state")&&!bl(n.state))throw new TypeError(Gr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Yy({},n),n.copy===!1?o=!1:n.state&&(n.state=yl(n.state.length,n.state,1,new ql(n.state.length),1)),n.copy=!1,a=Tu(n)}}else{if(i=arguments[0],t=arguments[1],g=B$(i,t),g)throw g;if(arguments.length>2){if(n=arguments[2],!Jy(n))throw new TypeError(Gr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(ra(n,"copy")&&!Uy(n.copy))throw new TypeError(Gr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(ra(n,"prng")){if(!Cy(n.prng))throw new TypeError(Gr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(ra(n,"state")&&!bl(n.state))throw new TypeError(Gr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Yy({},n),n.copy===!1?o=!1:n.state&&(n.state=yl(n.state.length,n.state,1,new ql(n.state.length),1)),n.copy=!1,a=Tu(n)}}else n={copy:!1},a=Tu(n)}return n&&n.prng?e=Xy({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),e=Xy({state:r,copy:!1})),i===void 0?u=h:u=v,xr(u,"NAME","beta"),n&&n.prng?(xr(u,"seed",null),xr(u,"seedLength",null),ky(u,"state",By(null),U$),xr(u,"stateLength",null),xr(u,"byteLength",null),xr(u,"toJSON",By(null)),xr(u,"PRNG",a)):(_u(u,"seed",d),_u(u,"seedLength",m),ky(u,"state",y,f),_u(u,"stateLength",c),_u(u,"byteLength",p),xr(u,"toJSON",l),xr(u,"PRNG",a),a=a.normalized),u;function d(){return a.seed}function m(){return a.seedLength}function c(){return a.stateLength}function p(){return a.byteLength}function y(){return a.state}function f(q){if(!bl(q))throw new TypeError(Gr("invalid argument. Must provide a Uint32Array. Value: `%s`.",q));o&&(q=yl(q.length,q,1,new ql(q.length),1)),a.state=q}function l(){var q={};return q.type="PRNG",q.name=u.NAME,q.state=C$(a.state),i===void 0?q.params=[]:q.params=[i,t],q}function v(){return Hy(a,e,i,t)}function h(q,b){return Dy(q)||Dy(b)||q<=0||b<=0?NaN:Hy(a,e,q,b)}}Zy.exports=X$});var $y=s(function(HBe,Qy){"use strict";var D$=wl(),Y$=D$();Qy.exports=Y$});var rn=s(function(ZBe,eq){"use strict";var H$=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ky=$y(),Z$=wl();H$(Ky,"factory",Z$);eq.exports=Ky});var rq=s(function(QBe,Q$){Q$.exports={dtype:"float64"}});var nq=s(function($Be,iq){"use strict";var $$=require("@stdlib/array/typed-real-float-dtypes"),K$=require("@stdlib/assert/is-plain-object"),eK=require("@stdlib/assert/has-own-property"),tq=require("@stdlib/string/format"),Sl=$$();Sl.push("generic");function rK(r,e){return K$(e)?eK(e,"dtype")&&(r.dtype=e.dtype,Sl.indexOf(r.dtype)<0)?new TypeError(tq('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Sl.join('", "'),r.dtype)):null:new TypeError(tq("invalid argument. Options argument must be an object. Value: `%s`.",e))}iq.exports=rK});var Ol=s(function(KBe,vq){"use strict";var aq=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ms=require("@stdlib/utils/define-nonenumerable-read-only-property"),ju=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sq=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),tK=require("@stdlib/utils/constant-function"),iK=require("@stdlib/utils/noop"),Mu=rn(),uq=require("@stdlib/array/typed-real-float-ctors"),oq=require("@stdlib/array/base/filled-by"),nK=require("@stdlib/strided/base/nullary"),aK=require("@stdlib/strided/base/binary"),gq=require("@stdlib/string/format"),sK=rq(),xu=nq();function uK(){var r,e,i,t,n,a;if(i={dtype:sK.dtype},e=arguments.length,e===0)n=Mu,t=o;else if(e===1){if(r=arguments[0],n=Mu.factory(r),a=xu(i,r),a)throw a;t=o}else if(e===2)n=Mu.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=Mu.factory(arguments[0],arguments[1],r),a=xu(i,r),a)throw a;t=u}return r&&r.prng?(ms(t,"seed",null),ms(t,"seedLength",null),sq(t,"state",tK(null),iK),ms(t,"stateLength",null),ms(t,"byteLength",null)):(ju(t,"seed",g),ju(t,"seedLength",d),sq(t,"state",p,y),ju(t,"stateLength",m),ju(t,"byteLength",c)),ms(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!aq(f))throw new TypeError(gq("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=xu(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?oq(f,n):(v=uq(b),h=new v(f),nK([h],[f],[1],n),h)}function o(f,l,v,h){var q,b,w,S,O;if(!aq(f))throw new TypeError(gq("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(O={},arguments.length>3&&(w=xu(O,h),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return oq(f,M);return q=uq(S),b=new q(f),aK([[l],[v],b],[f],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}vq.exports=uK});var dq=s(function(e9e,fq){"use strict";var oK=Ol(),gK=oK();fq.exports=gK});var mq=s(function(r9e,cq){"use strict";var vK=require("@stdlib/utils/define-nonenumerable-read-only-property"),lq=dq(),fK=Ol();vK(lq,"factory",fK);cq.exports=lq});var qq=s(function(t9e,yq){"use strict";var hq=require("@stdlib/assert/is-positive-number").isPrimitive,pq=require("@stdlib/string/format");function dK(r,e){return hq(r)?hq(e)?null:new TypeError(pq("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(pq("invalid argument. First argument must be a positive number. Value: `%s`.",r))}yq.exports=dK});var Sq=s(function(i9e,wq){"use strict";var bq=require("@stdlib/math/base/special/ln");function lK(r,e,i,t,n){var a,u,o,g,d,m,c;for(a=!0;a;){do d=e(),c=1+n*d;while(c<=0);c*=c*c,u=d*d,o=1-.331*u*u,g=.5*u+t*(1-c+bq(c)),m=r(),(m2){if(n=arguments[2],!Nq(n))throw new TypeError(Vr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(ta(n,"copy")&&!Lq(n.copy))throw new TypeError(Vr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(ta(n,"prng")){if(!Eq(n.prng))throw new TypeError(Vr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(ta(n,"state")&&!Nl(n.state))throw new TypeError(Vr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=jq({},n),n.copy===!1?o=!1:n.state&&(n.state=El(n.state.length,n.state,1,new Rl(n.state.length),1)),n.copy=!1,a=Au(n)}}else n={copy:!1},a=Au(n)}return n&&n.prng?i=Pq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),i=Pq({state:r,copy:!1})),e===void 0?u=w:(e>=1?(u=q,m=e-Fu):(u=b,m=e+1-Fu),d=1/Ll(9*m)),Ar(u,"NAME","gamma"),n&&n.prng?(Ar(u,"seed",null),Ar(u,"seedLength",null),Oq(u,"state",Rq(null),cK),Ar(u,"stateLength",null),Ar(u,"byteLength",null),Ar(u,"toJSON",Rq(null)),Ar(u,"PRNG",a)):(Gu(u,"seed",c),Gu(u,"seedLength",p),Oq(u,"state",l,v),Gu(u,"stateLength",y),Gu(u,"byteLength",f),Ar(u,"toJSON",h),Ar(u,"PRNG",a),a=a.normalized),u;function c(){return a.seed}function p(){return a.seedLength}function y(){return a.stateLength}function f(){return a.byteLength}function l(){return a.state}function v(S){if(!Nl(S))throw new TypeError(Vr("invalid argument. Must provide a Uint32Array. Value: `%s`.",S));o&&(S=El(S.length,S,1,new Rl(S.length),1)),a.state=S}function h(){var S={};return S.type="PRNG",S.name=u.NAME,S.state=mK(a.state),e===void 0?S.params=[]:S.params=[e,t],S}function q(){return Vu(a,i,t,m,d)}function b(){return Vu(a,i,t,m,d)*Tq(a(),1/e)}function w(S,O){var M,W;return _q(S)||_q(O)||S<=0||O<=0?NaN:S<1?(W=S+1-Fu,M=1/Ll(9*W),Vu(a,i,O,W,M)*Tq(a(),1/S)):(W=S-Fu,M=1/Ll(9*W),Vu(a,i,O,W,M))}}Mq.exports=pK});var Gq=s(function(a9e,xq){"use strict";var yK=Pl(),qK=yK();xq.exports=qK});var ze=s(function(s9e,Vq){"use strict";var bK=require("@stdlib/utils/define-nonenumerable-read-only-property"),Aq=Gq(),wK=Pl();bK(Aq,"factory",wK);Vq.exports=Aq});var zq=s(function(u9e,Iq){"use strict";var Fq=require("@stdlib/assert/is-positive-number").isPrimitive,Wq=require("@stdlib/string/format");function SK(r,e){return Fq(r)?Fq(e)?null:new TypeError(Wq("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(Wq("invalid argument. First argument must be a positive number. Value: `%s`.",r))}Iq.exports=SK});var Jq=s(function(o9e,kq){"use strict";function OK(r,e,i){return r(e,1)/r(i,1)}kq.exports=OK});var _l=s(function(g9e,Hq){"use strict";var vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Uq=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Cq=require("@stdlib/assert/is-plain-object"),Bq=require("@stdlib/utils/constant-function"),NK=require("@stdlib/utils/noop"),Iu=ze().factory,Xq=require("@stdlib/math/base/assert/is-nan"),LK=require("@stdlib/array/to-json"),Dq=require("@stdlib/string/format"),EK=zq(),Yq=Jq();function RK(){var r,e,i,t,n,a,u;if(arguments.length===0)r=Iu();else if(arguments.length===1){if(t=arguments[0],!Cq(t))throw new TypeError(Dq("invalid argument. Options argument must be an object. Value: `%s`.",t));r=Iu(t)}else{if(e=arguments[0],i=arguments[1],u=EK(e,i),u)throw u;if(arguments.length>2){if(t=arguments[2],!Cq(t))throw new TypeError(Dq("invalid argument. Options argument must be an object. Value: `%s`.",t));r=Iu(t)}else r=Iu()}return e===void 0?a=l:a=f,n=r.PRNG,vt(a,"NAME","betaprime"),t&&t.prng?(vt(a,"seed",null),vt(a,"seedLength",null),Uq(a,"state",Bq(null),NK),vt(a,"stateLength",null),vt(a,"byteLength",null),vt(a,"toJSON",Bq(null))):(Wu(a,"seed",o),Wu(a,"seedLength",g),Uq(a,"state",c,p),Wu(a,"stateLength",d),Wu(a,"byteLength",m),vt(a,"toJSON",y)),vt(a,"PRNG",n),a;function o(){return n.seed}function g(){return n.seedLength}function d(){return n.stateLength}function m(){return n.byteLength}function c(){return n.state}function p(v){n.state=v}function y(){var v={};return v.type="PRNG",v.name=a.NAME,v.state=LK(n.state),e===void 0?v.params=[]:v.params=[e,i],v}function f(){return Yq(r,e,i)}function l(v,h){return Xq(v)||Xq(h)||v<=0||h<=0?NaN:Yq(r,v,h)}}Hq.exports=RK});var Qq=s(function(v9e,Zq){"use strict";var PK=_l(),_K=PK();Zq.exports=_K});var tn=s(function(f9e,Kq){"use strict";var TK=require("@stdlib/utils/define-nonenumerable-read-only-property"),$q=Qq(),jK=_l();TK($q,"factory",jK);Kq.exports=$q});var eb=s(function(d9e,MK){MK.exports={dtype:"float64"}});var ib=s(function(l9e,tb){"use strict";var xK=require("@stdlib/array/typed-real-float-dtypes"),GK=require("@stdlib/assert/is-plain-object"),AK=require("@stdlib/assert/has-own-property"),rb=require("@stdlib/string/format"),Tl=xK();Tl.push("generic");function VK(r,e){return GK(e)?AK(e,"dtype")&&(r.dtype=e.dtype,Tl.indexOf(r.dtype)<0)?new TypeError(rb('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Tl.join('", "'),r.dtype)):null:new TypeError(rb("invalid argument. Options argument must be an object. Value: `%s`.",e))}tb.exports=VK});var jl=s(function(c9e,gb){"use strict";var nb=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,hs=require("@stdlib/utils/define-nonenumerable-read-only-property"),zu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ab=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),FK=require("@stdlib/utils/constant-function"),WK=require("@stdlib/utils/noop"),ku=tn(),sb=require("@stdlib/array/typed-real-float-ctors"),ub=require("@stdlib/array/base/filled-by"),IK=require("@stdlib/strided/base/nullary"),zK=require("@stdlib/strided/base/binary"),ob=require("@stdlib/string/format"),kK=eb(),Ju=ib();function JK(){var r,e,i,t,n,a;if(i={dtype:kK.dtype},e=arguments.length,e===0)n=ku,t=o;else if(e===1){if(r=arguments[0],n=ku.factory(r),a=Ju(i,r),a)throw a;t=o}else if(e===2)n=ku.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=ku.factory(arguments[0],arguments[1],r),a=Ju(i,r),a)throw a;t=u}return r&&r.prng?(hs(t,"seed",null),hs(t,"seedLength",null),ab(t,"state",FK(null),WK),hs(t,"stateLength",null),hs(t,"byteLength",null)):(zu(t,"seed",g),zu(t,"seedLength",d),ab(t,"state",p,y),zu(t,"stateLength",m),zu(t,"byteLength",c)),hs(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!nb(f))throw new TypeError(ob("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=Ju(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?ub(f,n):(v=sb(b),h=new v(f),IK([h],[f],[1],n),h)}function o(f,l,v,h){var q,b,w,S,O;if(!nb(f))throw new TypeError(ob("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(O={},arguments.length>3&&(w=Ju(O,h),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return ub(f,M);return q=sb(S),b=new q(f),zK([[l],[v],b],[f],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}gb.exports=JK});var fb=s(function(m9e,vb){"use strict";var UK=jl(),CK=UK();vb.exports=CK});var cb=s(function(h9e,lb){"use strict";var BK=require("@stdlib/utils/define-nonenumerable-read-only-property"),db=fb(),XK=jl();BK(db,"factory",XK);lb.exports=db});var pb=s(function(p9e,hb){"use strict";var DK=require("@stdlib/assert/is-number").isPrimitive,YK=require("@stdlib/assert/is-positive-number").isPrimitive,mb=require("@stdlib/string/format"),HK=require("@stdlib/assert/is-nan");function ZK(r,e){return!DK(r)||HK(r)?new TypeError(mb("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):YK(e)?null:new TypeError(mb("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}hb.exports=ZK});var qb=s(function(y9e,yb){"use strict";var QK=require("@stdlib/stats/base/dists/cosine/quantile");function $K(r,e,i){return QK(r(),e,i)}yb.exports=$K});var Ml=s(function(q9e,Rb){"use strict";var Fr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bb=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wb=require("@stdlib/assert/is-plain-object"),Sb=require("@stdlib/assert/is-function"),Ob=require("@stdlib/assert/has-own-property"),Nb=require("@stdlib/utils/constant-function"),KK=require("@stdlib/utils/noop"),Cu=j().factory,Lb=require("@stdlib/math/base/assert/is-nan"),eee=require("@stdlib/array/to-json"),Bu=require("@stdlib/string/format"),ree=pb(),Eb=qb();function tee(){var r,e,i,t,n,a;if(arguments.length===0)e=Cu();else if(arguments.length===1){if(r=arguments[0],!wb(r))throw new TypeError(Bu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Ob(r,"prng")){if(!Sb(r.prng))throw new TypeError(Bu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Cu(r)}else{if(n=arguments[0],a=arguments[1],t=ree(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!wb(r))throw new TypeError(Bu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Ob(r,"prng")){if(!Sb(r.prng))throw new TypeError(Bu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Cu(r)}else e=Cu()}return n===void 0?i=f:i=y,Fr(i,"NAME","cosine"),r&&r.prng?(Fr(i,"seed",null),Fr(i,"seedLength",null),bb(i,"state",Nb(null),KK),Fr(i,"stateLength",null),Fr(i,"byteLength",null),Fr(i,"toJSON",Nb(null)),Fr(i,"PRNG",e)):(Uu(i,"seed",u),Uu(i,"seedLength",o),bb(i,"state",m,c),Uu(i,"stateLength",g),Uu(i,"byteLength",d),Fr(i,"toJSON",p),Fr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function d(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function p(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=eee(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return Eb(e,n,a)}function f(l,v){return Lb(l)||Lb(v)||v<=0?NaN:Eb(e,l,v)}}Rb.exports=tee});var _b=s(function(b9e,Pb){"use strict";var iee=Ml(),nee=iee();Pb.exports=nee});var nn=s(function(w9e,jb){"use strict";var aee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tb=_b(),see=Ml();aee(Tb,"factory",see);jb.exports=Tb});var Mb=s(function(S9e,uee){uee.exports={dtype:"float64"}});var Ab=s(function(O9e,Gb){"use strict";var oee=require("@stdlib/array/typed-real-float-dtypes"),gee=require("@stdlib/assert/is-plain-object"),vee=require("@stdlib/assert/has-own-property"),xb=require("@stdlib/string/format"),xl=oee();xl.push("generic");function fee(r,e){return gee(e)?vee(e,"dtype")&&(r.dtype=e.dtype,xl.indexOf(r.dtype)<0)?new TypeError(xb('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",xl.join('", "'),r.dtype)):null:new TypeError(xb("invalid argument. Options argument must be an object. Value: `%s`.",e))}Gb.exports=fee});var Gl=s(function(N9e,kb){"use strict";var Vb=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ps=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Fb=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dee=require("@stdlib/utils/constant-function"),lee=require("@stdlib/utils/noop"),Du=nn(),Wb=require("@stdlib/array/typed-real-float-ctors"),Ib=require("@stdlib/array/base/filled-by"),cee=require("@stdlib/strided/base/nullary"),mee=require("@stdlib/strided/base/binary"),zb=require("@stdlib/string/format"),hee=Mb(),Yu=Ab();function pee(){var r,e,i,t,n,a;if(i={dtype:hee.dtype},e=arguments.length,e===0)n=Du,t=o;else if(e===1){if(r=arguments[0],n=Du.factory(r),a=Yu(i,r),a)throw a;t=o}else if(e===2)n=Du.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=Du.factory(arguments[0],arguments[1],r),a=Yu(i,r),a)throw a;t=u}return r&&r.prng?(ps(t,"seed",null),ps(t,"seedLength",null),Fb(t,"state",dee(null),lee),ps(t,"stateLength",null),ps(t,"byteLength",null)):(Xu(t,"seed",g),Xu(t,"seedLength",d),Fb(t,"state",p,y),Xu(t,"stateLength",m),Xu(t,"byteLength",c)),ps(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!Vb(f))throw new TypeError(zb("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=Yu(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?Ib(f,n):(v=Wb(b),h=new v(f),cee([h],[f],[1],n),h)}function o(f,l,v,h){var q,b,w,S,O;if(!Vb(f))throw new TypeError(zb("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(O={},arguments.length>3&&(w=Yu(O,h),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return Ib(f,M);return q=Wb(S),b=new q(f),mee([[l],[v],b],[f],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}kb.exports=pee});var Ub=s(function(L9e,Jb){"use strict";var yee=Gl(),qee=yee();Jb.exports=qee});var Xb=s(function(E9e,Bb){"use strict";var bee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cb=Ub(),wee=Gl();bee(Cb,"factory",wee);Bb.exports=Cb});var Zb=s(function(R9e,Hb){"use strict";var Db=require("@stdlib/assert/is-integer").isPrimitive,Al=require("@stdlib/string/format"),Yb=require("@stdlib/assert/is-nan");function See(r,e){return!Db(r)||Yb(r)?new TypeError(Al("invalid argument. First argument must be an integer and not NaN. Value: `%s`.",r)):!Db(e)||Yb(e)?new TypeError(Al("invalid argument. Second argument must be an integer and not NaN. Value: `%s`.",e)):r>e?new RangeError(Al("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e)):null}Hb.exports=See});var Kb=s(function(P9e,$b){"use strict";var Vl=require("@stdlib/constants/float64/max-safe-integer"),ia=require("@stdlib/math/base/special/floor");function Qb(r,e,i){var t,n,a,u,o,g,d,m,c;if(a=i-e,a===0)return e;if(d=r.MIN,m=r.MAX,n=m-d,n===a)return r()-d+e;if(nVl/g)&&(c*=g,t+=c,!(t>a)))return t+e}for(n===Vl?(o=ia(n/(a+1)),n%(a+1)===a&&(o+=1)):o=ia((n+1)/(a+1));;)if(t=r()-d,t=ia(t/o),t<=a)return t+e}$b.exports=Qb});var Fl=s(function(_9e,uw){"use strict";var Wr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ew=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rw=require("@stdlib/assert/is-plain-object"),tw=require("@stdlib/assert/is-function"),iw=require("@stdlib/assert/has-own-property"),nw=require("@stdlib/utils/constant-function"),Oee=require("@stdlib/utils/noop"),Zu=j().factory,aw=require("@stdlib/math/base/assert/is-nan"),na=require("@stdlib/math/base/assert/is-integer"),Nee=require("@stdlib/array/to-json"),ft=require("@stdlib/string/format"),Lee=Zb(),sw=Kb();function Eee(){var r,e,i,t,n,a;if(arguments.length===0)e=Zu();else if(arguments.length===1){if(r=arguments[0],!rw(r))throw new TypeError(ft("invalid argument. Options argument must be an object. Value: `%s`.",r));if(iw(r,"prng")){if(!tw(r.prng))throw new TypeError(ft("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));if(e=r.prng,!na(e.MIN))throw new TypeError(ft("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!na(e.MAX))throw new TypeError(ft("invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.","prng"))}else e=Zu(r)}else{if(n=arguments[0],a=arguments[1],t=Lee(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!rw(r))throw new TypeError(ft("invalid argument. Options argument must be an object. Value: `%s`.",r));if(iw(r,"prng")){if(!tw(r.prng))throw new TypeError(ft("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));if(e=r.prng,!na(e.MIN))throw new TypeError(ft("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!na(e.MAX))throw new TypeError(ft("invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.","prng"))}else e=Zu(r)}else e=Zu()}return n===void 0?i=f:i=y,Wr(i,"NAME","discrete-uniform"),r&&r.prng?(Wr(i,"seed",null),Wr(i,"seedLength",null),ew(i,"state",nw(null),Oee),Wr(i,"stateLength",null),Wr(i,"byteLength",null),Wr(i,"toJSON",nw(null)),Wr(i,"PRNG",e)):(Hu(i,"seed",u),Hu(i,"seedLength",o),ew(i,"state",m,c),Hu(i,"stateLength",g),Hu(i,"byteLength",d),Wr(i,"toJSON",p),Wr(i,"PRNG",e)),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function d(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function p(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=Nee(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return sw(e,n,a)}function f(l,v){return aw(l)||aw(v)||!na(l)||!na(v)||l>v?NaN:sw(e,l,v)}}uw.exports=Eee});var gw=s(function(T9e,ow){"use strict";var Ree=Fl(),Pee=Ree();ow.exports=Pee});var an=s(function(j9e,fw){"use strict";var _ee=require("@stdlib/utils/define-nonenumerable-read-only-property"),vw=gw(),Tee=Fl();_ee(vw,"factory",Tee);fw.exports=vw});var dw=s(function(M9e,jee){jee.exports={dtype:"float64"}});var mw=s(function(x9e,cw){"use strict";var Mee=require("@stdlib/array/typed-real-dtypes"),xee=require("@stdlib/assert/is-plain-object"),Gee=require("@stdlib/assert/has-own-property"),lw=require("@stdlib/string/format"),Wl=Mee();Wl.push("generic");function Aee(r,e){return xee(e)?Gee(e,"dtype")&&(r.dtype=e.dtype,Wl.indexOf(r.dtype)<0)?new TypeError(lw('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Wl.join('", "'),r.dtype)):null:new TypeError(lw("invalid argument. Options argument must be an object. Value: `%s`.",e))}cw.exports=Aee});var Il=s(function(G9e,ww){"use strict";var hw=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ys=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Vee=require("@stdlib/utils/constant-function"),Fee=require("@stdlib/utils/noop"),$u=an(),yw=require("@stdlib/array/typed-real-ctors"),qw=require("@stdlib/array/base/filled-by"),Wee=require("@stdlib/strided/base/nullary"),Iee=require("@stdlib/strided/base/binary"),bw=require("@stdlib/string/format"),zee=dw(),Ku=mw();function kee(){var r,e,i,t,n,a;if(i={dtype:zee.dtype},e=arguments.length,e===0)n=$u,t=o;else if(e===1){if(r=arguments[0],n=$u.factory(r),a=Ku(i,r),a)throw a;t=o}else if(e===2)n=$u.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=$u.factory(arguments[0],arguments[1],r),a=Ku(i,r),a)throw a;t=u}return r&&r.prng?(ys(t,"seed",null),ys(t,"seedLength",null),pw(t,"state",Vee(null),Fee),ys(t,"stateLength",null),ys(t,"byteLength",null)):(Qu(t,"seed",g),Qu(t,"seedLength",d),pw(t,"state",p,y),Qu(t,"stateLength",m),Qu(t,"byteLength",c)),ys(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!hw(f))throw new TypeError(bw("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=Ku(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?qw(f,n):(v=yw(b),h=new v(f),Wee([h],[f],[1],n),h)}function o(f,l,v,h){var q,b,w,S,O;if(!hw(f))throw new TypeError(bw("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(O={},arguments.length>3&&(w=Ku(O,h),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return qw(f,M);return q=yw(S),b=new q(f),Iee([[l],[v],b],[f],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}ww.exports=kee});var Ow=s(function(A9e,Sw){"use strict";var Jee=Il(),Uee=Jee();Sw.exports=Uee});var Ew=s(function(V9e,Lw){"use strict";var Cee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nw=Ow(),Bee=Il();Cee(Nw,"factory",Bee);Lw.exports=Nw});var Pw=s(function(F9e,Rw){"use strict";var Xee=require("@stdlib/math/base/special/ln");function Dee(r,e){return-Xee(1-r())/e}Rw.exports=Dee});var zl=s(function(W9e,Aw){"use strict";var Ir=require("@stdlib/utils/define-nonenumerable-read-only-property"),eo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_w=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Yee=require("@stdlib/assert/is-positive-number").isPrimitive,Tw=require("@stdlib/assert/is-plain-object"),jw=require("@stdlib/assert/is-function"),Mw=require("@stdlib/assert/has-own-property"),xw=require("@stdlib/utils/constant-function"),Hee=require("@stdlib/utils/noop"),ro=j().factory,Zee=require("@stdlib/math/base/assert/is-nan"),Qee=require("@stdlib/array/to-json"),to=require("@stdlib/string/format"),Gw=Pw();function $ee(){var r,e,i,t;if(arguments.length===0)i=ro();else if(arguments.length===1&&Tw(arguments[0]))if(e=arguments[0],Mw(e,"prng")){if(!jw(e.prng))throw new TypeError(to("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=ro(e);else{if(r=arguments[0],!Yee(r))throw new TypeError(to("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!Tw(e))throw new TypeError(to("invalid argument. Options argument must be an object. Value: `%s`.",e));if(Mw(e,"prng")){if(!jw(e.prng))throw new TypeError(to("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=ro(e)}else i=ro()}return r===void 0?t=p:t=c,Ir(t,"NAME","exponential"),e&&e.prng?(Ir(t,"seed",null),Ir(t,"seedLength",null),_w(t,"state",xw(null),Hee),Ir(t,"stateLength",null),Ir(t,"byteLength",null),Ir(t,"toJSON",xw(null)),Ir(t,"PRNG",i)):(eo(t,"seed",n),eo(t,"seedLength",a),_w(t,"state",g,d),eo(t,"stateLength",u),eo(t,"byteLength",o),Ir(t,"toJSON",m),Ir(t,"PRNG",i),i=i.normalized),t;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function d(y){i.state=y}function m(){var y={};return y.type="PRNG",y.name=t.NAME,y.state=Qee(i.state),r===void 0?y.params=[]:y.params=[r],y}function c(){return Gw(i,r)}function p(y){return Zee(y)||y<=0?NaN:Gw(i,y)}}Aw.exports=$ee});var Fw=s(function(I9e,Vw){"use strict";var Kee=zl(),ere=Kee();Vw.exports=ere});var sn=s(function(z9e,Iw){"use strict";var rre=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ww=Fw(),tre=zl();rre(Ww,"factory",tre);Iw.exports=Ww});var zw=s(function(k9e,ire){ire.exports={dtype:"float64"}});var Uw=s(function(J9e,Jw){"use strict";var nre=require("@stdlib/array/typed-real-float-dtypes"),are=require("@stdlib/assert/is-plain-object"),sre=require("@stdlib/assert/has-own-property"),kw=require("@stdlib/string/format"),kl=nre();kl.push("generic");function ure(r,e){return are(e)?sre(e,"dtype")&&(r.dtype=e.dtype,kl.indexOf(r.dtype)<0)?new TypeError(kw('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",kl.join('", "'),r.dtype)):null:new TypeError(kw("invalid argument. Options argument must be an object. Value: `%s`.",e))}Jw.exports=ure});var Ul=s(function(U9e,Hw){"use strict";var Cw=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ore=require("@stdlib/assert/is-number").isPrimitive,qs=require("@stdlib/utils/define-nonenumerable-read-only-property"),io=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Bw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gre=require("@stdlib/utils/constant-function"),vre=require("@stdlib/utils/noop"),Jl=sn(),Xw=require("@stdlib/array/typed-real-float-ctors"),Dw=require("@stdlib/array/base/filled-by"),fre=require("@stdlib/strided/base/nullary"),dre=require("@stdlib/strided/base/unary"),Yw=require("@stdlib/string/format"),lre=zw(),no=Uw();function cre(){var r,e,i,t,n,a;if(i={dtype:lre.dtype},e=arguments.length,e===0)n=Jl,t=o;else if(e===1)if(r=arguments[0],n=Jl.factory(r),ore(r))t=u;else{if(a=no(i,r),a)throw a;t=o}else if(e===2){if(r=arguments[1],n=Jl.factory(arguments[0],r),a=no(i,r),a)throw a;t=u}return r&&r.prng?(qs(t,"seed",null),qs(t,"seedLength",null),Bw(t,"state",gre(null),vre),qs(t,"stateLength",null),qs(t,"byteLength",null)):(io(t,"seed",g),io(t,"seedLength",d),Bw(t,"state",p,y),io(t,"stateLength",m),io(t,"byteLength",c)),qs(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!Cw(f))throw new TypeError(Yw("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=no(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?Dw(f,n):(v=Xw(b),h=new v(f),fre([h],[f],[1],n),h)}function o(f,l,v){var h,q,b,w,S;if(!Cw(f))throw new TypeError(Yw("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(S={},arguments.length>2&&(b=no(S,v),b))throw b;if(w=S.dtype||i.dtype,w==="generic")return Dw(f,O);return h=Xw(w),q=new h(f),dre([[l],q],[f],[0,1],n),q;function O(){return n(l)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}Hw.exports=cre});var Qw=s(function(C9e,Zw){"use strict";var mre=Ul(),hre=mre();Zw.exports=hre});var eS=s(function(B9e,Kw){"use strict";var pre=require("@stdlib/utils/define-nonenumerable-read-only-property"),$w=Qw(),yre=Ul();pre($w,"factory",yre);Kw.exports=$w});var rS=s(function(X9e,qre){qre.exports={dtype:"float64"}});var nS=s(function(D9e,iS){"use strict";var bre=require("@stdlib/array/typed-real-float-dtypes"),wre=require("@stdlib/assert/is-plain-object"),Sre=require("@stdlib/assert/has-own-property"),tS=require("@stdlib/string/format"),Cl=bre();Cl.push("generic");function Ore(r,e){return wre(e)?Sre(e,"dtype")&&(r.dtype=e.dtype,Cl.indexOf(r.dtype)<0)?new TypeError(tS('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Cl.join('", "'),r.dtype)):null:new TypeError(tS("invalid argument. Options argument must be an object. Value: `%s`.",e))}iS.exports=Ore});var Bl=s(function(Y9e,vS){"use strict";var aS=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bs=require("@stdlib/utils/define-nonenumerable-read-only-property"),ao=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Nre=require("@stdlib/utils/constant-function"),Lre=require("@stdlib/utils/noop"),so=ze(),uS=require("@stdlib/array/typed-real-float-ctors"),oS=require("@stdlib/array/base/filled-by"),Ere=require("@stdlib/strided/base/nullary"),Rre=require("@stdlib/strided/base/binary"),gS=require("@stdlib/string/format"),Pre=rS(),uo=nS();function _re(){var r,e,i,t,n,a;if(i={dtype:Pre.dtype},e=arguments.length,e===0)n=so,t=o;else if(e===1){if(r=arguments[0],n=so.factory(r),a=uo(i,r),a)throw a;t=o}else if(e===2)n=so.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=so.factory(arguments[0],arguments[1],r),a=uo(i,r),a)throw a;t=u}return r&&r.prng?(bs(t,"seed",null),bs(t,"seedLength",null),sS(t,"state",Nre(null),Lre),bs(t,"stateLength",null),bs(t,"byteLength",null)):(ao(t,"seed",g),ao(t,"seedLength",d),sS(t,"state",p,y),ao(t,"stateLength",m),ao(t,"byteLength",c)),bs(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!aS(f))throw new TypeError(gS("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=uo(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?oS(f,n):(v=uS(b),h=new v(f),Ere([h],[f],[1],n),h)}function o(f,l,v,h){var q,b,w,S,O;if(!aS(f))throw new TypeError(gS("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(O={},arguments.length>3&&(w=uo(O,h),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return oS(f,M);return q=uS(S),b=new q(f),Rre([[l],[v],b],[f],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}vS.exports=_re});var dS=s(function(H9e,fS){"use strict";var Tre=Bl(),jre=Tre();fS.exports=jre});var mS=s(function(Z9e,cS){"use strict";var Mre=require("@stdlib/utils/define-nonenumerable-read-only-property"),lS=dS(),xre=Bl();Mre(lS,"factory",xre);cS.exports=lS});var yS=s(function(Q9e,pS){"use strict";var Gre=require("@stdlib/math/base/special/floor"),hS=require("@stdlib/math/base/special/ln");function Are(r,e){var i=r();return i===0&&(i=r()),Gre(hS(i)/hS(1-e))}pS.exports=Are});var Xl=s(function($9e,LS){"use strict";var zr=require("@stdlib/utils/define-nonenumerable-read-only-property"),oo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bS=require("@stdlib/assert/is-plain-object"),Vre=require("@stdlib/assert/is-probability").isPrimitive,wS=require("@stdlib/assert/is-function"),SS=require("@stdlib/assert/has-own-property"),OS=require("@stdlib/utils/constant-function"),Fre=require("@stdlib/utils/noop"),go=j().factory,Wre=require("@stdlib/math/base/assert/is-nan"),Ire=require("@stdlib/array/to-json"),vo=require("@stdlib/string/format"),NS=yS();function zre(){var r,e,i,t;if(arguments.length===0)e=go();else if(arguments.length===1&&bS(arguments[0]))if(r=arguments[0],SS(r,"prng")){if(!wS(r.prng))throw new TypeError(vo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=go(r);else{if(t=arguments[0],!Vre(t))throw new TypeError(vo("invalid argument. First argument must be a probability. Value: `%s`.",t));if(arguments.length>1){if(r=arguments[1],!bS(r))throw new TypeError(vo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(SS(r,"prng")){if(!wS(r.prng))throw new TypeError(vo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=go(r)}else e=go()}return t===void 0?i=p:i=c,zr(i,"NAME","geometric"),r&&r.prng?(zr(i,"seed",null),zr(i,"seedLength",null),qS(i,"state",OS(null),Fre),zr(i,"stateLength",null),zr(i,"byteLength",null),zr(i,"toJSON",OS(null)),zr(i,"PRNG",e)):(oo(i,"seed",n),oo(i,"seedLength",a),qS(i,"state",g,d),oo(i,"stateLength",u),oo(i,"byteLength",o),zr(i,"toJSON",m),zr(i,"PRNG",e),e=e.normalized),i;function n(){return e.seed}function a(){return e.seedLength}function u(){return e.stateLength}function o(){return e.byteLength}function g(){return e.state}function d(y){e.state=y}function m(){var y={};return y.type="PRNG",y.name=i.NAME,y.state=Ire(e.state),t===void 0?y.params=[]:y.params=[t],y}function c(){return NS(e,t)}function p(y){return Wre(y)||y<0||y>1?NaN:NS(e,y)}}LS.exports=zre});var RS=s(function(K9e,ES){"use strict";var kre=Xl(),Jre=kre();ES.exports=Jre});var aa=s(function(e8e,_S){"use strict";var Ure=require("@stdlib/utils/define-nonenumerable-read-only-property"),PS=RS(),Cre=Xl();Ure(PS,"factory",Cre);_S.exports=PS});var TS=s(function(r8e,Bre){Bre.exports={dtype:"float64"}});var xS=s(function(t8e,MS){"use strict";var Xre=require("@stdlib/array/typed-real-float-dtypes"),Dre=require("@stdlib/assert/is-plain-object"),Yre=require("@stdlib/assert/has-own-property"),jS=require("@stdlib/string/format"),Dl=Xre();Dl.push("generic");function Hre(r,e){return Dre(e)?Yre(e,"dtype")&&(r.dtype=e.dtype,Dl.indexOf(r.dtype)<0)?new TypeError(jS('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Dl.join('", "'),r.dtype)):null:new TypeError(jS("invalid argument. Options argument must be an object. Value: `%s`.",e))}MS.exports=Hre});var Hl=s(function(i8e,IS){"use strict";var GS=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zre=require("@stdlib/assert/is-number").isPrimitive,ws=require("@stdlib/utils/define-nonenumerable-read-only-property"),fo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),AS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Qre=require("@stdlib/utils/constant-function"),$re=require("@stdlib/utils/noop"),Yl=aa(),VS=require("@stdlib/array/typed-real-float-ctors"),FS=require("@stdlib/array/base/filled-by"),Kre=require("@stdlib/strided/base/nullary"),ete=require("@stdlib/strided/base/unary"),WS=require("@stdlib/string/format"),rte=TS(),lo=xS();function tte(){var r,e,i,t,n,a;if(i={dtype:rte.dtype},e=arguments.length,e===0)n=Yl,t=o;else if(e===1)if(r=arguments[0],n=Yl.factory(r),Zre(r))t=u;else{if(a=lo(i,r),a)throw a;t=o}else if(e===2){if(r=arguments[1],n=Yl.factory(arguments[0],r),a=lo(i,r),a)throw a;t=u}return r&&r.prng?(ws(t,"seed",null),ws(t,"seedLength",null),AS(t,"state",Qre(null),$re),ws(t,"stateLength",null),ws(t,"byteLength",null)):(fo(t,"seed",g),fo(t,"seedLength",d),AS(t,"state",p,y),fo(t,"stateLength",m),fo(t,"byteLength",c)),ws(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!GS(f))throw new TypeError(WS("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=lo(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?FS(f,n):(v=VS(b),h=new v(f),Kre([h],[f],[1],n),h)}function o(f,l,v){var h,q,b,w,S;if(!GS(f))throw new TypeError(WS("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(S={},arguments.length>2&&(b=lo(S,v),b))throw b;if(w=S.dtype||i.dtype,w==="generic")return FS(f,O);return h=VS(w),q=new h(f),ete([[l],q],[f],[0,1],n),q;function O(){return n(l)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}IS.exports=tte});var kS=s(function(n8e,zS){"use strict";var ite=Hl(),nte=ite();zS.exports=nte});var CS=s(function(a8e,US){"use strict";var ate=require("@stdlib/utils/define-nonenumerable-read-only-property"),JS=kS(),ste=Hl();ate(JS,"factory",ste);US.exports=JS});var YS=s(function(s8e,DS){"use strict";var BS=require("@stdlib/assert/is-positive-number").isPrimitive,XS=require("@stdlib/string/format");function ute(r,e){return BS(r)?BS(e)?null:new TypeError(XS("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(XS("invalid argument. First argument must be a positive number. Value: `%s`.",r))}DS.exports=ute});var Zl=s(function(u8e,rO){"use strict";var dt=require("@stdlib/utils/define-nonenumerable-read-only-property"),co=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),HS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ZS=require("@stdlib/assert/is-plain-object"),QS=require("@stdlib/assert/is-function"),$S=require("@stdlib/assert/has-own-property"),KS=require("@stdlib/utils/constant-function"),ote=require("@stdlib/utils/noop"),sa=ze().factory,eO=require("@stdlib/math/base/assert/is-nan"),gte=require("@stdlib/array/to-json"),mo=require("@stdlib/string/format"),vte=YS();function fte(){var r,e,i,t,n,a,u;if(arguments.length===0)r=sa();else if(arguments.length===1){if(t=arguments[0],!ZS(t))throw new TypeError(mo("invalid argument. Options argument must be an object. Value: `%s`.",t));if($S(t,"prng")){if(!QS(t.prng))throw new TypeError(mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=sa({prng:t.prng})}else r=sa(t)}else{if(e=arguments[0],i=arguments[1],u=vte(e,i),u)throw u;if(arguments.length>2){if(t=arguments[2],!ZS(t))throw new TypeError(mo("invalid argument. Options argument must be an object. Value: `%s`.",t));if($S(t,"prng")){if(!QS(t.prng))throw new TypeError(mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=sa(e,i,{prng:t.prng})}else r=sa(e,i,t)}else r=sa(e,i)}return e===void 0?a=l:a=f,n=r.PRNG,dt(a,"NAME","invgamma"),t&&t.prng?(dt(a,"seed",null),dt(a,"seedLength",null),HS(a,"state",KS(null),ote),dt(a,"stateLength",null),dt(a,"byteLength",null),dt(a,"toJSON",KS(null))):(co(a,"seed",o),co(a,"seedLength",g),HS(a,"state",c,p),co(a,"stateLength",d),co(a,"byteLength",m),dt(a,"toJSON",y)),dt(a,"PRNG",n),a;function o(){return n.seed}function g(){return n.seedLength}function d(){return n.stateLength}function m(){return n.byteLength}function c(){return n.state}function p(v){n.state=v}function y(){var v={};return v.type="PRNG",v.name=a.NAME,v.state=gte(n.state),e===void 0?v.params=[]:v.params=[e,i],v}function f(){return 1/r()}function l(v,h){return eO(v)||eO(h)||v<=0||h<=0?NaN:1/r(v,h)}}rO.exports=fte});var iO=s(function(o8e,tO){"use strict";var dte=Zl(),lte=dte();tO.exports=lte});var un=s(function(g8e,aO){"use strict";var cte=require("@stdlib/utils/define-nonenumerable-read-only-property"),nO=iO(),mte=Zl();cte(nO,"factory",mte);aO.exports=nO});var sO=s(function(v8e,hte){hte.exports={dtype:"float64"}});var gO=s(function(f8e,oO){"use strict";var pte=require("@stdlib/array/typed-real-float-dtypes"),yte=require("@stdlib/assert/is-plain-object"),qte=require("@stdlib/assert/has-own-property"),uO=require("@stdlib/string/format"),Ql=pte();Ql.push("generic");function bte(r,e){return yte(e)?qte(e,"dtype")&&(r.dtype=e.dtype,Ql.indexOf(r.dtype)<0)?new TypeError(uO('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Ql.join('", "'),r.dtype)):null:new TypeError(uO("invalid argument. Options argument must be an object. Value: `%s`.",e))}oO.exports=bte});var $l=s(function(d8e,mO){"use strict";var vO=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ss=require("@stdlib/utils/define-nonenumerable-read-only-property"),ho=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wte=require("@stdlib/utils/constant-function"),Ste=require("@stdlib/utils/noop"),po=un(),dO=require("@stdlib/array/typed-real-float-ctors"),lO=require("@stdlib/array/base/filled-by"),Ote=require("@stdlib/strided/base/nullary"),Nte=require("@stdlib/strided/base/binary"),cO=require("@stdlib/string/format"),Lte=sO(),yo=gO();function Ete(){var r,e,i,t,n,a;if(i={dtype:Lte.dtype},e=arguments.length,e===0)n=po,t=o;else if(e===1){if(r=arguments[0],n=po.factory(r),a=yo(i,r),a)throw a;t=o}else if(e===2)n=po.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=po.factory(arguments[0],arguments[1],r),a=yo(i,r),a)throw a;t=u}return r&&r.prng?(Ss(t,"seed",null),Ss(t,"seedLength",null),fO(t,"state",wte(null),Ste),Ss(t,"stateLength",null),Ss(t,"byteLength",null)):(ho(t,"seed",g),ho(t,"seedLength",d),fO(t,"state",p,y),ho(t,"stateLength",m),ho(t,"byteLength",c)),Ss(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!vO(f))throw new TypeError(cO("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=yo(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?lO(f,n):(v=dO(b),h=new v(f),Ote([h],[f],[1],n),h)}function o(f,l,v,h){var q,b,w,S,O;if(!vO(f))throw new TypeError(cO("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(O={},arguments.length>3&&(w=yo(O,h),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return lO(f,M);return q=dO(S),b=new q(f),Nte([[l],[v],b],[f],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}mO.exports=Ete});var pO=s(function(l8e,hO){"use strict";var Rte=$l(),Pte=Rte();hO.exports=Pte});var bO=s(function(c8e,qO){"use strict";var _te=require("@stdlib/utils/define-nonenumerable-read-only-property"),yO=pO(),Tte=$l();_te(yO,"factory",Tte);qO.exports=yO});var OO=s(function(m8e,SO){"use strict";var jte=require("@stdlib/assert/is-number").isPrimitive,Mte=require("@stdlib/assert/is-positive-number").isPrimitive,wO=require("@stdlib/string/format"),xte=require("@stdlib/assert/is-nan");function Gte(r,e){return!jte(r)||xte(r)?new TypeError(wO("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Mte(e)?null:new TypeError(wO("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}SO.exports=Gte});var LO=s(function(h8e,NO){"use strict";var Ate=require("@stdlib/math/base/special/exp");function Vte(r,e,i){return Ate(e+i*r())}NO.exports=Vte});var Kl=s(function(p8e,xO){"use strict";var lt=require("@stdlib/utils/define-nonenumerable-read-only-property"),qo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),EO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),RO=require("@stdlib/assert/is-plain-object"),PO=require("@stdlib/assert/is-function"),_O=require("@stdlib/assert/has-own-property"),TO=require("@stdlib/utils/constant-function"),Fte=require("@stdlib/utils/noop"),ua=Y().factory,jO=require("@stdlib/math/base/assert/is-nan"),Wte=require("@stdlib/array/to-json"),bo=require("@stdlib/string/format"),Ite=OO(),MO=LO();function zte(){var r,e,i,t,n,a,u;if(arguments.length===0)e=ua();else if(arguments.length===1){if(i=arguments[0],!RO(i))throw new TypeError(bo("invalid argument. Options argument must be an object. Value: `%s`.",i));if(_O(i,"prng")){if(!PO(i.prng))throw new TypeError(bo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=ua({prng:i.prng})}else e=ua(i)}else{if(u=arguments[0],r=arguments[1],a=Ite(u,r),a)throw a;if(arguments.length>2){if(i=arguments[2],!RO(i))throw new TypeError(bo("invalid argument. Options argument must be an object. Value: `%s`.",i));if(_O(i,"prng")){if(!PO(i.prng))throw new TypeError(bo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=ua({prng:i.prng})}else e=ua(i)}else e=ua()}return u===void 0?n=l:n=f,t=e.PRNG,lt(n,"NAME","lognormal"),i&&i.prng?(lt(n,"seed",null),lt(n,"seedLength",null),EO(n,"state",TO(null),Fte),lt(n,"stateLength",null),lt(n,"byteLength",null),lt(n,"toJSON",TO(null))):(qo(n,"seed",o),qo(n,"seedLength",g),EO(n,"state",c,p),qo(n,"stateLength",d),qo(n,"byteLength",m),lt(n,"toJSON",y)),lt(n,"PRNG",t),n;function o(){return t.seed}function g(){return t.seedLength}function d(){return t.stateLength}function m(){return t.byteLength}function c(){return t.state}function p(v){t.state=v}function y(){var v={};return v.type="PRNG",v.name=n.NAME,v.state=Wte(t.state),u===void 0?v.params=[]:v.params=[u,r],v}function f(){return MO(e,u,r)}function l(v,h){return jO(v)||jO(h)||h<=0?NaN:MO(e,v,h)}}xO.exports=zte});var AO=s(function(y8e,GO){"use strict";var kte=Kl(),Jte=kte();GO.exports=Jte});var on=s(function(q8e,FO){"use strict";var Ute=require("@stdlib/utils/define-nonenumerable-read-only-property"),VO=AO(),Cte=Kl();Ute(VO,"factory",Cte);FO.exports=VO});var WO=s(function(b8e,Bte){Bte.exports={dtype:"float64"}});var kO=s(function(w8e,zO){"use strict";var Xte=require("@stdlib/array/typed-real-float-dtypes"),Dte=require("@stdlib/assert/is-plain-object"),Yte=require("@stdlib/assert/has-own-property"),IO=require("@stdlib/string/format"),ec=Xte();ec.push("generic");function Hte(r,e){return Dte(e)?Yte(e,"dtype")&&(r.dtype=e.dtype,ec.indexOf(r.dtype)<0)?new TypeError(IO('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",ec.join('", "'),r.dtype)):null:new TypeError(IO("invalid argument. Options argument must be an object. Value: `%s`.",e))}zO.exports=Hte});var rc=s(function(S8e,DO){"use strict";var JO=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Os=require("@stdlib/utils/define-nonenumerable-read-only-property"),wo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),UO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Zte=require("@stdlib/utils/constant-function"),Qte=require("@stdlib/utils/noop"),So=on(),CO=require("@stdlib/array/typed-real-float-ctors"),BO=require("@stdlib/array/base/filled-by"),$te=require("@stdlib/strided/base/nullary"),Kte=require("@stdlib/strided/base/binary"),XO=require("@stdlib/string/format"),eie=WO(),Oo=kO();function rie(){var r,e,i,t,n,a;if(i={dtype:eie.dtype},e=arguments.length,e===0)n=So,t=o;else if(e===1){if(r=arguments[0],n=So.factory(r),a=Oo(i,r),a)throw a;t=o}else if(e===2)n=So.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=So.factory(arguments[0],arguments[1],r),a=Oo(i,r),a)throw a;t=u}return r&&r.prng?(Os(t,"seed",null),Os(t,"seedLength",null),UO(t,"state",Zte(null),Qte),Os(t,"stateLength",null),Os(t,"byteLength",null)):(wo(t,"seed",g),wo(t,"seedLength",d),UO(t,"state",p,y),wo(t,"stateLength",m),wo(t,"byteLength",c)),Os(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!JO(f))throw new TypeError(XO("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=Oo(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?BO(f,n):(v=CO(b),h=new v(f),$te([h],[f],[1],n),h)}function o(f,l,v,h){var q,b,w,S,O;if(!JO(f))throw new TypeError(XO("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(O={},arguments.length>3&&(w=Oo(O,h),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return BO(f,M);return q=CO(S),b=new q(f),Kte([[l],[v],b],[f],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}DO.exports=rie});var HO=s(function(O8e,YO){"use strict";var tie=rc(),iie=tie();YO.exports=iie});var $O=s(function(N8e,QO){"use strict";var nie=require("@stdlib/utils/define-nonenumerable-read-only-property"),ZO=HO(),aie=rc();nie(ZO,"factory",aie);QO.exports=ZO});var tc=s(function(L8e,KO){"use strict";var sie=require("@stdlib/constants/int32/max"),uie=require("@stdlib/math/base/special/floor"),oie=sie-1;function gie(){var r=uie(1+oie*Math.random());return r|0}KO.exports=gie});var ac=s(function(E8e,nN){"use strict";var kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),ct=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),eN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ic=require("@stdlib/assert/has-own-property"),vie=require("@stdlib/assert/is-plain-object"),fie=require("@stdlib/assert/is-boolean").isPrimitive,die=require("@stdlib/assert/is-collection"),lie=require("@stdlib/assert/is-positive-integer").isPrimitive,rN=require("@stdlib/assert/is-int32array"),ke=require("@stdlib/string/format"),No=require("@stdlib/constants/int32/max"),U=require("@stdlib/array/int32"),oa=require("@stdlib/blas/base/gcopy"),cie=require("@stdlib/array/to-json"),tN=tc(),nc=No-1|0,mie=No-1|0,hie=16807,Lo=1,Eo=2,mt=2,C=4,Ns=5;function iN(r,e){var i;return e?i="option":i="argument",r.lengthmie)throw new RangeError(ke("invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.","seed",n));n|=0}else if(die(n)&&n.length>0)a=n.length,e=new U(Ns+a),e[0]=Lo,e[1]=Eo,e[mt]=1,e[C]=a,oa.ndarray(a,n,1,0,e,1,C+1),i=new U(e.buffer,e.byteOffset+(mt+1)*e.BYTES_PER_ELEMENT,1),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,a),i[0]=n[0];else throw new TypeError(ke("invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.","seed",n));else n=tN()|0}else n=tN()|0;return i===void 0&&(e=new U(Ns+1),e[0]=Lo,e[1]=Eo,e[mt]=1,e[C]=1,e[C+1]=n,i=new U(e.buffer,e.byteOffset+(mt+1)*e.BYTES_PER_ELEMENT,1),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,1),i[0]=n[0]),kr(f,"NAME","minstd"),ct(f,"seed",o),ct(f,"seedLength",g),eN(f,"state",c,p),ct(f,"stateLength",d),ct(f,"byteLength",m),kr(f,"toJSON",y),kr(f,"MIN",1),kr(f,"MAX",No-1),kr(f,"normalized",l),kr(l,"NAME",f.NAME),ct(l,"seed",o),ct(l,"seedLength",g),eN(l,"state",c,p),ct(l,"stateLength",d),ct(l,"byteLength",m),kr(l,"toJSON",y),kr(l,"MIN",(f.MIN-1)/nc),kr(l,"MAX",(f.MAX-1)/nc),f;function o(){var v=e[C];return oa(v,n,1,new U(v),1)}function g(){return e[C]}function d(){return e.length}function m(){return e.byteLength}function c(){var v=e.length;return oa(v,e,1,new U(v),1)}function p(v){var h;if(!rN(v))throw new TypeError(ke("invalid argument. Must provide an Int32Array. Value: `%s`.",v));if(h=iN(v,!1),h)throw h;t.copy===!1?t.state&&v.length===e.length?oa(v.length,v,1,e,1):(e=v,t.state=!0):(v.length!==e.length&&(e=new U(v.length)),oa(v.length,v,1,e,1)),i=new U(e.buffer,e.byteOffset+(mt+1)*e.BYTES_PER_ELEMENT,1),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,e[C])}function y(){var v={};return v.type="PRNG",v.name=f.NAME,v.state=cie(e),v.params=[],v}function f(){var v=i[0]|0;return v=hie*v%No|0,i[0]=v,v|0}function l(){return(f()-1)/nc}}nN.exports=pie});var sN=s(function(R8e,aN){"use strict";var yie=ac(),qie=tc(),bie=yie({seed:qie()});aN.exports=bie});var H=s(function(P8e,oN){"use strict";var wie=require("@stdlib/utils/define-nonenumerable-read-only-property"),uN=sN(),Sie=ac();wie(uN,"factory",Sie);oN.exports=uN});var gN=s(function(_8e,Oie){Oie.exports={idtype:"float64",ndtype:"float64"}});var fN=s(function(T8e,vN){"use strict";var Nie=require("@stdlib/array/typed-real-float-dtypes"),Lie=require("@stdlib/array/typed-real-dtypes"),Eie=require("@stdlib/assert/is-plain-object"),Ro=require("@stdlib/assert/has-own-property"),Ls=require("@stdlib/string/format"),Es=Lie(),Rs=Nie();Es.push("generic");Rs.push("generic");function Rie(r,e,i){if(!Eie(e))return new TypeError(Ls("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i===0){if(Ro(e,"idtype")&&(r.idtype=e.idtype,Es.indexOf(r.idtype)<0))return new TypeError(Ls('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",Es.join('", "'),r.idtype));if(Ro(e,"ndtype")&&(r.ndtype=e.ndtype,Rs.indexOf(r.ndtype)<0))return new TypeError(Ls('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",Rs.join('", "'),r.ndtype))}else if(i===1&&Ro(e,"dtype")){if(r.dtype=e.dtype,Es.indexOf(r.dtype)<0)return new TypeError(Ls('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Es.join('", "'),r.dtype))}else if(Ro(e,"dtype")&&(r.dtype=e.dtype,Rs.indexOf(r.dtype)<0))return new TypeError(Ls('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Rs.join('", "'),r.dtype));return null}vN.exports=Rie});var uc=s(function(j8e,bN){"use strict";var dN=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,lN=require("@stdlib/utils/define-nonenumerable-read-only-property"),Po=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Pie=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cN=H(),mN=require("@stdlib/array/typed-real-ctors"),hN=require("@stdlib/array/base/filled-by"),pN=require("@stdlib/strided/base/nullary"),yN=require("@stdlib/string/format"),qN=gN(),sc=fN();function _ie(){var r,e,i,t,n,a;if(i={idtype:qN.idtype,ndtype:qN.ndtype},e=arguments.length,t=u,e===0)n=cN;else if(e===1&&(r=arguments[0],n=cN.factory(r),a=sc(i,r,0),a))throw a;return Po(t,"seed",g),Po(t,"seedLength",d),Pie(t,"state",p,y),Po(t,"stateLength",m),Po(t,"byteLength",c),lN(t,"PRNG",n),lN(t,"normalized",o),t;function u(f,l){var v,h,q,b,w;if(!dN(f))throw new TypeError(yN("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=sc(w,l,1),q))throw q;return b=w.dtype||i.idtype,b==="generic"?hN(f,n):(v=mN(b),h=new v(f),pN([h],[f],[1],n),h)}function o(f,l){var v,h,q,b,w;if(!dN(f))throw new TypeError(yN("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=sc(w,l,2),q))throw q;return b=w.dtype||i.ndtype,b==="generic"?hN(f,n.normalized):(v=mN(b),h=new v(f),pN([h],[f],[1],n.normalized),h)}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}bN.exports=_ie});var SN=s(function(M8e,wN){"use strict";var Tie=uc(),jie=Tie();wN.exports=jie});var LN=s(function(x8e,NN){"use strict";var Mie=require("@stdlib/utils/define-nonenumerable-read-only-property"),ON=SN(),xie=uc();Mie(ON,"factory",xie);NN.exports=ON});var RN=s(function(G8e,EN){"use strict";var Gie=require("@stdlib/math/base/assert/is-nan"),Aie=8;function Vie(r,e,i){var t,n;for(n=0;n=0;n--)e[n]=r();return e}EN.exports=Vie});var oc=s(function(A8e,PN){"use strict";var Fie=require("@stdlib/constants/int32/max"),Wie=require("@stdlib/math/base/special/floor"),Iie=Fie-1;function zie(){var r=Wie(1+Iie*Math.random());return r|0}PN.exports=zie});var fc=s(function(V8e,GN){"use strict";var Jr=require("@stdlib/utils/define-nonenumerable-read-only-property"),ht=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_N=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gc=require("@stdlib/assert/has-own-property"),kie=require("@stdlib/assert/is-plain-object"),Jie=require("@stdlib/assert/is-boolean").isPrimitive,Uie=require("@stdlib/assert/is-collection"),Cie=require("@stdlib/assert/is-positive-integer").isPrimitive,TN=require("@stdlib/assert/is-int32array"),ga=require("@stdlib/blas/base/gcopy"),Bie=require("@stdlib/math/base/special/floor"),B=require("@stdlib/array/int32"),Ps=require("@stdlib/constants/int32/max"),Xie=require("@stdlib/array/to-json"),Z=require("@stdlib/string/format"),jN=RN(),MN=oc(),vc=Ps-1|0,Die=Ps-1|0,Yie=16807,D=32,jo=1,Mo=3,pt=2,va=D+3,X=D+6,_s=D+7,_o=va+1,To=va+2;function xN(r,e){var i;return e?i="option":i="argument",r.length<_s+1?new RangeError(Z("invalid %s. State array has insufficient length.",i)):r[0]!==jo?new RangeError(Z("invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.",i,jo,r[0])):r[1]!==Mo?new RangeError(Z("invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.",i,Mo,r[1])):r[pt]!==D?new RangeError(Z("invalid %s. State array has an incompatible table length. Expected: `%s`. Actual: `%s`.",i,D,r[pt])):r[va]!==2?new RangeError(Z("invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.",i,2,r[va])):r[X]!==r.length-_s?new RangeError(Z("invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.",i,r.length-_s,r[X])):null}function Hie(r){var e,i,t,n,a,u;if(t={},arguments.length){if(!kie(r))throw new TypeError(Z("invalid argument. Options argument must be an object. Value: `%s`.",r));if(gc(r,"copy")&&(t.copy=r.copy,!Jie(r.copy)))throw new TypeError(Z("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(gc(r,"state")){if(i=r.state,t.state=!0,!TN(i))throw new TypeError(Z("invalid option. `%s` option must be an Int32Array. Option: `%s`.","state",i));if(u=xN(i,!0),u)throw u;t.copy===!1?e=i:(e=new B(i.length),ga(i.length,i,1,e,1)),i=new B(e.buffer,e.byteOffset+(pt+1)*e.BYTES_PER_ELEMENT,D),n=new B(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,i[X])}if(n===void 0)if(gc(r,"seed"))if(n=r.seed,t.seed=!0,Cie(n)){if(n>Die)throw new RangeError(Z("invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.","seed",n));n|=0}else if(Uie(n)&&n.length>0)a=n.length,e=new B(_s+a),e[0]=jo,e[1]=Mo,e[pt]=D,e[va]=2,e[To]=n[0],e[X]=a,ga.ndarray(a,n,1,0,e,1,X+1),i=new B(e.buffer,e.byteOffset+(pt+1)*e.BYTES_PER_ELEMENT,D),n=new B(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,a),i=jN(f,i,D),e[_o]=i[0];else throw new TypeError(Z("invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.","seed",n));else n=MN()|0}else n=MN()|0;return i===void 0&&(e=new B(_s+1),e[0]=jo,e[1]=Mo,e[pt]=D,e[va]=2,e[To]=n,e[X]=1,e[X+1]=n,i=new B(e.buffer,e.byteOffset+(pt+1)*e.BYTES_PER_ELEMENT,D),n=new B(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,1),i=jN(f,i,D),e[_o]=i[0]),Jr(l,"NAME","minstd-shuffle"),ht(l,"seed",o),ht(l,"seedLength",g),_N(l,"state",c,p),ht(l,"stateLength",d),ht(l,"byteLength",m),Jr(l,"toJSON",y),Jr(l,"MIN",1),Jr(l,"MAX",Ps-1),Jr(l,"normalized",v),Jr(v,"NAME",l.NAME),ht(v,"seed",o),ht(v,"seedLength",g),_N(v,"state",c,p),ht(v,"stateLength",d),ht(v,"byteLength",m),Jr(v,"toJSON",y),Jr(v,"MIN",(l.MIN-1)/vc),Jr(v,"MAX",(l.MAX-1)/vc),l;function o(){var h=e[X];return ga(h,n,1,new B(h),1)}function g(){return e[X]}function d(){return e.length}function m(){return e.byteLength}function c(){var h=e.length;return ga(h,e,1,new B(h),1)}function p(h){var q;if(!TN(h))throw new TypeError(Z("invalid argument. Must provide an Int32Array. Value: `%s`.",h));if(q=xN(h,!1),q)throw q;t.copy===!1?t.state&&h.length===e.length?ga(h.length,h,1,e,1):(e=h,t.state=!0):(h.length!==e.length&&(e=new B(h.length)),ga(h.length,h,1,e,1)),i=new B(e.buffer,e.byteOffset+(pt+1)*e.BYTES_PER_ELEMENT,D),n=new B(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,e[X])}function y(){var h={};return h.type="PRNG",h.name=l.NAME,h.state=Xie(e),h.params=[],h}function f(){var h=e[To]|0;return h=Yie*h%Ps|0,e[To]=h,h|0}function l(){var h,q;return h=e[_o],q=Bie(D*(h/Ps)),h=i[q],e[_o]=h,i[q]=f(),h}function v(){return(l()-1)/vc}}GN.exports=Hie});var VN=s(function(F8e,AN){"use strict";var Zie=fc(),Qie=oc(),$ie=Zie({seed:Qie()});AN.exports=$ie});var Q=s(function(W8e,WN){"use strict";var Kie=require("@stdlib/utils/define-nonenumerable-read-only-property"),FN=VN(),ene=fc();Kie(FN,"factory",ene);WN.exports=FN});var IN=s(function(I8e,rne){rne.exports={idtype:"float64",ndtype:"float64"}});var kN=s(function(z8e,zN){"use strict";var tne=require("@stdlib/array/typed-real-float-dtypes"),ine=require("@stdlib/array/typed-real-dtypes"),nne=require("@stdlib/assert/is-plain-object"),xo=require("@stdlib/assert/has-own-property"),Ts=require("@stdlib/string/format"),js=ine(),Ms=tne();js.push("generic");Ms.push("generic");function ane(r,e,i){if(!nne(e))return new TypeError(Ts("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i===0){if(xo(e,"idtype")&&(r.idtype=e.idtype,js.indexOf(r.idtype)<0))return new TypeError(Ts('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",js.join('", "'),r.idtype));if(xo(e,"ndtype")&&(r.ndtype=e.ndtype,Ms.indexOf(r.ndtype)<0))return new TypeError(Ts('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",Ms.join('", "'),r.ndtype))}else if(i===1&&xo(e,"dtype")){if(r.dtype=e.dtype,js.indexOf(r.dtype)<0)return new TypeError(Ts('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",js.join('", "'),r.dtype))}else if(xo(e,"dtype")&&(r.dtype=e.dtype,Ms.indexOf(r.dtype)<0))return new TypeError(Ts('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Ms.join('", "'),r.dtype));return null}zN.exports=ane});var lc=s(function(k8e,ZN){"use strict";var JN=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,UN=require("@stdlib/utils/define-nonenumerable-read-only-property"),Go=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sne=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),CN=Q(),BN=require("@stdlib/array/typed-real-ctors"),XN=require("@stdlib/array/base/filled-by"),DN=require("@stdlib/strided/base/nullary"),YN=require("@stdlib/string/format"),HN=IN(),dc=kN();function une(){var r,e,i,t,n,a;if(i={idtype:HN.idtype,ndtype:HN.ndtype},e=arguments.length,t=u,e===0)n=CN;else if(e===1&&(r=arguments[0],n=CN.factory(r),a=dc(i,r,0),a))throw a;return Go(t,"seed",g),Go(t,"seedLength",d),sne(t,"state",p,y),Go(t,"stateLength",m),Go(t,"byteLength",c),UN(t,"PRNG",n),UN(t,"normalized",o),t;function u(f,l){var v,h,q,b,w;if(!JN(f))throw new TypeError(YN("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=dc(w,l,1),q))throw q;return b=w.dtype||i.idtype,b==="generic"?XN(f,n):(v=BN(b),h=new v(f),DN([h],[f],[1],n),h)}function o(f,l){var v,h,q,b,w;if(!JN(f))throw new TypeError(YN("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=dc(w,l,2),q))throw q;return b=w.dtype||i.ndtype,b==="generic"?XN(f,n.normalized):(v=BN(b),h=new v(f),DN([h],[f],[1],n.normalized),h)}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}ZN.exports=une});var $N=s(function(J8e,QN){"use strict";var one=lc(),gne=one();QN.exports=gne});var rL=s(function(U8e,eL){"use strict";var vne=require("@stdlib/utils/define-nonenumerable-read-only-property"),KN=$N(),fne=lc();vne(KN,"factory",fne);eL.exports=KN});var tL=s(function(C8e,dne){dne.exports={idtype:"float64",ndtype:"float64"}});var nL=s(function(B8e,iL){"use strict";var lne=require("@stdlib/array/typed-real-float-dtypes"),cne=require("@stdlib/array/typed-real-dtypes"),mne=require("@stdlib/assert/is-plain-object"),Ao=require("@stdlib/assert/has-own-property"),xs=require("@stdlib/string/format"),Gs=cne(),As=lne();Gs.push("generic");As.push("generic");function hne(r,e,i){if(!mne(e))return new TypeError(xs("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i===0){if(Ao(e,"idtype")&&(r.idtype=e.idtype,Gs.indexOf(r.idtype)<0))return new TypeError(xs('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",Gs.join('", "'),r.idtype));if(Ao(e,"ndtype")&&(r.ndtype=e.ndtype,As.indexOf(r.ndtype)<0))return new TypeError(xs('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",As.join('", "'),r.ndtype))}else if(i===1&&Ao(e,"dtype")){if(r.dtype=e.dtype,Gs.indexOf(r.dtype)<0)return new TypeError(xs('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Gs.join('", "'),r.dtype))}else if(Ao(e,"dtype")&&(r.dtype=e.dtype,As.indexOf(r.dtype)<0))return new TypeError(xs('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",As.join('", "'),r.dtype));return null}iL.exports=hne});var mc=s(function(X8e,lL){"use strict";var aL=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,sL=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pne=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),uL=j(),oL=require("@stdlib/array/typed-real-ctors"),gL=require("@stdlib/array/base/filled-by"),vL=require("@stdlib/strided/base/nullary"),fL=require("@stdlib/string/format"),dL=tL(),cc=nL();function yne(){var r,e,i,t,n,a;if(i={idtype:dL.idtype,ndtype:dL.ndtype},e=arguments.length,t=u,e===0)n=uL;else if(e===1&&(r=arguments[0],n=uL.factory(r),a=cc(i,r,0),a))throw a;return Vo(t,"seed",g),Vo(t,"seedLength",d),pne(t,"state",p,y),Vo(t,"stateLength",m),Vo(t,"byteLength",c),sL(t,"PRNG",n),sL(t,"normalized",o),t;function u(f,l){var v,h,q,b,w;if(!aL(f))throw new TypeError(fL("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=cc(w,l,1),q))throw q;return b=w.dtype||i.idtype,b==="generic"?gL(f,n):(v=oL(b),h=new v(f),vL([h],[f],[1],n),h)}function o(f,l){var v,h,q,b,w;if(!aL(f))throw new TypeError(fL("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=cc(w,l,2),q))throw q;return b=w.dtype||i.ndtype,b==="generic"?gL(f,n.normalized):(v=oL(b),h=new v(f),vL([h],[f],[1],n.normalized),h)}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}lL.exports=yne});var mL=s(function(D8e,cL){"use strict";var qne=mc(),bne=qne();cL.exports=bne});var yL=s(function(Y8e,pL){"use strict";var wne=require("@stdlib/utils/define-nonenumerable-read-only-property"),hL=mL(),Sne=mc();wne(hL,"factory",Sne);pL.exports=hL});var wL=s(function(H8e,bL){"use strict";var One=require("@stdlib/assert/is-number").isPrimitive,Nne=require("@stdlib/assert/is-positive-number").isPrimitive,qL=require("@stdlib/string/format"),Lne=require("@stdlib/assert/is-nan");function Ene(r,e){return!One(r)||Lne(r)?new TypeError(qL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Nne(e)?null:new TypeError(qL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}bL.exports=Ene});var OL=s(function(Z8e,SL){"use strict";function Rne(r,e,i){return e+i*r()}SL.exports=Rne});var hc=s(function(Q8e,jL){"use strict";var yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),LL=require("@stdlib/assert/is-plain-object"),EL=require("@stdlib/assert/is-function"),RL=require("@stdlib/assert/has-own-property"),PL=require("@stdlib/utils/constant-function"),Pne=require("@stdlib/utils/noop"),fa=Y().factory,_L=require("@stdlib/math/base/assert/is-nan"),_ne=require("@stdlib/array/to-json"),Wo=require("@stdlib/string/format"),Tne=wL(),TL=OL();function jne(){var r,e,i,t,n,a,u;if(arguments.length===0)e=fa();else if(arguments.length===1){if(i=arguments[0],!LL(i))throw new TypeError(Wo("invalid argument. Options argument must be an object. Value: `%s`.",i));if(RL(i,"prng")){if(!EL(i.prng))throw new TypeError(Wo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=fa({prng:i.prng})}else e=fa(i)}else{if(u=arguments[0],r=arguments[1],a=Tne(u,r),a)throw a;if(arguments.length>2){if(i=arguments[2],!LL(i))throw new TypeError(Wo("invalid argument. Options argument must be an object. Value: `%s`.",i));if(RL(i,"prng")){if(!EL(i.prng))throw new TypeError(Wo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=fa({prng:i.prng})}else e=fa(i)}else e=fa()}return u===void 0?n=l:n=f,t=e.PRNG,yt(n,"NAME","normal"),i&&i.prng?(yt(n,"seed",null),yt(n,"seedLength",null),NL(n,"state",PL(null),Pne),yt(n,"stateLength",null),yt(n,"byteLength",null),yt(n,"toJSON",PL(null))):(Fo(n,"seed",o),Fo(n,"seedLength",g),NL(n,"state",c,p),Fo(n,"stateLength",d),Fo(n,"byteLength",m),yt(n,"toJSON",y)),yt(n,"PRNG",t),n;function o(){return t.seed}function g(){return t.seedLength}function d(){return t.stateLength}function m(){return t.byteLength}function c(){return t.state}function p(v){t.state=v}function y(){var v={};return v.type="PRNG",v.name=n.NAME,v.state=_ne(t.state),u===void 0?v.params=[]:v.params=[u,r],v}function f(){return TL(e,u,r)}function l(v,h){return _L(v)||_L(h)||h<=0?NaN:TL(e,v,h)}}jL.exports=jne});var xL=s(function($8e,ML){"use strict";var Mne=hc(),xne=Mne();ML.exports=xne});var gn=s(function(K8e,AL){"use strict";var Gne=require("@stdlib/utils/define-nonenumerable-read-only-property"),GL=xL(),Ane=hc();Gne(GL,"factory",Ane);AL.exports=GL});var VL=s(function(eXe,Vne){Vne.exports={dtype:"float64"}});var IL=s(function(rXe,WL){"use strict";var Fne=require("@stdlib/array/typed-real-float-dtypes"),Wne=require("@stdlib/assert/is-plain-object"),Ine=require("@stdlib/assert/has-own-property"),FL=require("@stdlib/string/format"),pc=Fne();pc.push("generic");function zne(r,e){return Wne(e)?Ine(e,"dtype")&&(r.dtype=e.dtype,pc.indexOf(r.dtype)<0)?new TypeError(FL('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",pc.join('", "'),r.dtype)):null:new TypeError(FL("invalid argument. Options argument must be an object. Value: `%s`.",e))}WL.exports=zne});var yc=s(function(tXe,BL){"use strict";var zL=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vs=require("@stdlib/utils/define-nonenumerable-read-only-property"),Io=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kne=require("@stdlib/utils/constant-function"),Jne=require("@stdlib/utils/noop"),zo=gn(),JL=require("@stdlib/array/typed-real-float-ctors"),UL=require("@stdlib/array/base/filled-by"),Une=require("@stdlib/strided/base/nullary"),Cne=require("@stdlib/strided/base/binary"),CL=require("@stdlib/string/format"),Bne=VL(),ko=IL();function Xne(){var r,e,i,t,n,a;if(i={dtype:Bne.dtype},e=arguments.length,e===0)n=zo,t=o;else if(e===1){if(r=arguments[0],n=zo.factory(r),a=ko(i,r),a)throw a;t=o}else if(e===2)n=zo.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=zo.factory(arguments[0],arguments[1],r),a=ko(i,r),a)throw a;t=u}return r&&r.prng?(Vs(t,"seed",null),Vs(t,"seedLength",null),kL(t,"state",kne(null),Jne),Vs(t,"stateLength",null),Vs(t,"byteLength",null)):(Io(t,"seed",g),Io(t,"seedLength",d),kL(t,"state",p,y),Io(t,"stateLength",m),Io(t,"byteLength",c)),Vs(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!zL(f))throw new TypeError(CL("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=ko(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?UL(f,n):(v=JL(b),h=new v(f),Une([h],[f],[1],n),h)}function o(f,l,v,h){var q,b,w,S,O;if(!zL(f))throw new TypeError(CL("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(O={},arguments.length>3&&(w=ko(O,h),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return UL(f,M);return q=JL(S),b=new q(f),Cne([[l],[v],b],[f],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}BL.exports=Xne});var DL=s(function(iXe,XL){"use strict";var Dne=yc(),Yne=Dne();XL.exports=Yne});var ZL=s(function(nXe,HL){"use strict";var Hne=require("@stdlib/utils/define-nonenumerable-read-only-property"),YL=DL(),Zne=yc();Hne(YL,"factory",Zne);HL.exports=YL});var QL=s(function(aXe,Qne){Qne.exports={name:"mt19937",copy:!0}});var KL=s(function(sXe,$L){"use strict";var $ne=H(),Kne=Q(),eae=j(),Jo={};Jo.minstd=$ne;Jo["minstd-shuffle"]=Kne;Jo.mt19937=eae;$L.exports=Jo});var qc=s(function(uXe,rE){"use strict";var Fs=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),rae=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),tae=require("@stdlib/assert/is-plain-object"),iae=require("@stdlib/assert/is-boolean").isPrimitive,Co=require("@stdlib/assert/has-own-property"),nae=require("@stdlib/array/to-json"),Ws=require("@stdlib/string/format"),eE=QL(),aae=KL();function sae(r){var e,i,t;if(e={name:eE.name,copy:eE.copy},arguments.length){if(!tae(r))throw new TypeError(Ws("invalid argument. Must provide an object. Value: `%s`.",r));if(Co(r,"name")&&(e.name=r.name),Co(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(Ws("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(Co(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(Ws("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(Co(r,"copy")&&(e.copy=r.copy,!iae(e.copy)))throw new TypeError(Ws("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(t=aae[e.name],t===void 0)throw new Error(Ws("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.state===void 0?e.seed===void 0?i=t.factory():i=t.factory({seed:e.seed}):i=t.factory({state:e.state,copy:e.copy}),Fs(c,"NAME","randu"),Uo(c,"seed",n),Uo(c,"seedLength",a),rae(c,"state",g,d),Uo(c,"stateLength",u),Uo(c,"byteLength",o),Fs(c,"toJSON",m),Fs(c,"PRNG",i),Fs(c,"MIN",i.normalized.MIN),Fs(c,"MAX",i.normalized.MAX),c;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function d(p){i.state=p}function m(){var p={};return p.type="PRNG",p.name=c.NAME+"-"+i.NAME,p.state=nae(i.state),p.params=[],p}function c(){return i.normalized()}}rE.exports=sae});var iE=s(function(oXe,tE){"use strict";var uae=qc(),oae=uae();tE.exports=oae});var qt=s(function(gXe,aE){"use strict";var gae=require("@stdlib/utils/define-nonenumerable-read-only-property"),nE=iE(),vae=qc();gae(nE,"factory",vae);aE.exports=nE});var sE=s(function(vXe,fae){fae.exports={dtype:"float64"}});var gE=s(function(fXe,oE){"use strict";var dae=require("@stdlib/array/typed-real-float-dtypes"),lae=require("@stdlib/assert/is-plain-object"),cae=require("@stdlib/assert/has-own-property"),uE=require("@stdlib/string/format"),bc=dae();bc.push("generic");function mae(r,e){return lae(e)?cae(e,"dtype")&&(r.dtype=e.dtype,bc.indexOf(r.dtype)<0)?new TypeError(uE('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",bc.join('", "'),r.dtype)):null:new TypeError(uE("invalid argument. Options argument must be an object. Value: `%s`.",e))}oE.exports=mae});var wc=s(function(dXe,dE){"use strict";var hae=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,pae=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yae=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),vE=qt(),qae=require("@stdlib/array/typed-real-float-ctors"),bae=require("@stdlib/array/base/filled-by"),wae=require("@stdlib/strided/base/nullary"),Sae=require("@stdlib/string/format"),Oae=sE(),fE=gE();function Nae(){var r,e,i,t,n,a;if(i={dtype:Oae.dtype},e=arguments.length,t=u,e===0)n=vE;else if(e===1&&(r=arguments[0],n=vE.factory(r),a=fE(i,r),a))throw a;return Bo(t,"seed",o),Bo(t,"seedLength",g),yae(t,"state",c,p),Bo(t,"stateLength",d),Bo(t,"byteLength",m),pae(t,"PRNG",n.PRNG),t;function u(y,f){var l,v,h,q,b;if(!hae(y))throw new TypeError(Sae("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",y));if(b={},arguments.length>1&&(h=fE(b,f),h))throw h;return q=b.dtype||i.dtype,q==="generic"?bae(y,n):(l=qae(q),v=new l(y),wae([v],[y],[1],n),v)}function o(){return t.PRNG.seed}function g(){return t.PRNG.seedLength}function d(){return t.PRNG.stateLength}function m(){return t.PRNG.byteLength}function c(){return t.PRNG.state}function p(y){t.PRNG.state=y}}dE.exports=Nae});var cE=s(function(lXe,lE){"use strict";var Lae=wc(),Eae=Lae();lE.exports=Eae});var pE=s(function(cXe,hE){"use strict";var Rae=require("@stdlib/utils/define-nonenumerable-read-only-property"),mE=cE(),Pae=wc();Rae(mE,"factory",Pae);hE.exports=mE});var wE=s(function(mXe,bE){"use strict";var yE=require("@stdlib/assert/is-number").isPrimitive,Sc=require("@stdlib/string/format"),qE=require("@stdlib/assert/is-nan");function _ae(r,e){return!yE(r)||qE(r)?new TypeError(Sc("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!yE(e)||qE(e)?new TypeError(Sc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(Sc("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}bE.exports=_ae});var OE=s(function(hXe,SE){"use strict";function Tae(r,e,i){var t=r();return i*t+(1-t)*e}SE.exports=Tae});var Oc=s(function(pXe,jE){"use strict";var Ur=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),LE=require("@stdlib/assert/is-plain-object"),EE=require("@stdlib/assert/is-function"),RE=require("@stdlib/assert/has-own-property"),PE=require("@stdlib/utils/constant-function"),jae=require("@stdlib/utils/noop"),Do=j().factory,_E=require("@stdlib/math/base/assert/is-nan"),Mae=require("@stdlib/array/to-json"),Yo=require("@stdlib/string/format"),xae=wE(),TE=OE();function Gae(){var r,e,i,t,n,a;if(arguments.length===0)e=Do();else if(arguments.length===1){if(r=arguments[0],!LE(r))throw new TypeError(Yo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(RE(r,"prng")){if(!EE(r.prng))throw new TypeError(Yo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Do(r)}else{if(n=arguments[0],a=arguments[1],t=xae(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!LE(r))throw new TypeError(Yo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(RE(r,"prng")){if(!EE(r.prng))throw new TypeError(Yo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Do(r)}else e=Do()}return n===void 0?i=f:i=y,Ur(i,"NAME","uniform"),r&&r.prng?(Ur(i,"seed",null),Ur(i,"seedLength",null),NE(i,"state",PE(null),jae),Ur(i,"stateLength",null),Ur(i,"byteLength",null),Ur(i,"toJSON",PE(null)),Ur(i,"PRNG",e)):(Xo(i,"seed",u),Xo(i,"seedLength",o),NE(i,"state",m,c),Xo(i,"stateLength",g),Xo(i,"byteLength",d),Ur(i,"toJSON",p),Ur(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function d(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function p(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=Mae(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return TE(e,n,a)}function f(l,v){return _E(l)||_E(v)||l>=v?NaN:TE(e,l,v)}}jE.exports=Gae});var xE=s(function(yXe,ME){"use strict";var Aae=Oc(),Vae=Aae();ME.exports=Vae});var vn=s(function(qXe,AE){"use strict";var Fae=require("@stdlib/utils/define-nonenumerable-read-only-property"),GE=xE(),Wae=Oc();Fae(GE,"factory",Wae);AE.exports=GE});var VE=s(function(bXe,Iae){Iae.exports={dtype:"float64"}});var IE=s(function(wXe,WE){"use strict";var zae=require("@stdlib/array/typed-real-float-dtypes"),kae=require("@stdlib/assert/is-plain-object"),Jae=require("@stdlib/assert/has-own-property"),FE=require("@stdlib/string/format"),Nc=zae();Nc.push("generic");function Uae(r,e){return kae(e)?Jae(e,"dtype")&&(r.dtype=e.dtype,Nc.indexOf(r.dtype)<0)?new TypeError(FE('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Nc.join('", "'),r.dtype)):null:new TypeError(FE("invalid argument. Options argument must be an object. Value: `%s`.",e))}WE.exports=Uae});var Lc=s(function(SXe,BE){"use strict";var zE=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Is=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ho=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Cae=require("@stdlib/utils/constant-function"),Bae=require("@stdlib/utils/noop"),Zo=vn(),JE=require("@stdlib/array/typed-real-float-ctors"),UE=require("@stdlib/array/base/filled-by"),Xae=require("@stdlib/strided/base/nullary"),Dae=require("@stdlib/strided/base/binary"),CE=require("@stdlib/string/format"),Yae=VE(),Qo=IE();function Hae(){var r,e,i,t,n,a;if(i={dtype:Yae.dtype},e=arguments.length,e===0)n=Zo,t=o;else if(e===1){if(r=arguments[0],n=Zo.factory(r),a=Qo(i,r),a)throw a;t=o}else if(e===2)n=Zo.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=Zo.factory(arguments[0],arguments[1],r),a=Qo(i,r),a)throw a;t=u}return r&&r.prng?(Is(t,"seed",null),Is(t,"seedLength",null),kE(t,"state",Cae(null),Bae),Is(t,"stateLength",null),Is(t,"byteLength",null)):(Ho(t,"seed",g),Ho(t,"seedLength",d),kE(t,"state",p,y),Ho(t,"stateLength",m),Ho(t,"byteLength",c)),Is(t,"PRNG",n.PRNG),t;function u(f,l){var v,h,q,b,w;if(!zE(f))throw new TypeError(CE("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(w={},arguments.length>1&&(q=Qo(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?UE(f,n):(v=JE(b),h=new v(f),Xae([h],[f],[1],n),h)}function o(f,l,v,h){var q,b,w,S,O;if(!zE(f))throw new TypeError(CE("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",f));if(O={},arguments.length>3&&(w=Qo(O,h),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return UE(f,M);return q=JE(S),b=new q(f),Dae([[l],[v],b],[f],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function d(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function p(){return t.PRNG.state}function y(f){t.PRNG.state=f}}BE.exports=Hae});var DE=s(function(OXe,XE){"use strict";var Zae=Lc(),Qae=Zae();XE.exports=Qae});var ZE=s(function(NXe,HE){"use strict";var $ae=require("@stdlib/utils/define-nonenumerable-read-only-property"),YE=DE(),Kae=Lc();$ae(YE,"factory",Kae);HE.exports=YE});var $E=s(function(LXe,QE){"use strict";var V=require("@stdlib/utils/define-read-only-property"),G={};V(G,"arcsine",ey());V(G,"beta",mq());V(G,"betaprime",cb());V(G,"cosine",Xb());V(G,"discreteUniform",Ew());V(G,"exponential",eS());V(G,"gamma",mS());V(G,"geometric",CS());V(G,"invgamma",bO());V(G,"lognormal",$O());V(G,"minstd",LN());V(G,"minstdShuffle",rL());V(G,"mt19937",yL());V(G,"normal",ZL());V(G,"randu",pE());V(G,"uniform",ZE());QE.exports=G});var Ec=s(function(EXe,nR){"use strict";var Cr=require("@stdlib/utils/define-nonenumerable-read-only-property"),$o=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),KE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),eR=require("@stdlib/assert/is-plain-object"),ese=require("@stdlib/assert/is-probability").isPrimitive,rR=require("@stdlib/assert/is-function"),tR=require("@stdlib/assert/has-own-property"),iR=require("@stdlib/utils/constant-function"),rse=require("@stdlib/utils/noop"),Ko=j().factory,tse=require("@stdlib/math/base/assert/is-nan"),ise=require("@stdlib/array/to-json"),eg=require("@stdlib/string/format");function nse(){var r,e,i,t;if(arguments.length===0)e=Ko();else if(arguments.length===1&&eR(arguments[0]))if(r=arguments[0],tR(r,"prng")){if(!rR(r.prng))throw new TypeError(eg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Ko(r);else{if(t=arguments[0],!ese(t))throw new TypeError(eg("invalid argument. First argument must be a probability. Value: `%s`.",t));if(arguments.length>1){if(r=arguments[1],!eR(r))throw new TypeError(eg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(tR(r,"prng")){if(!rR(r.prng))throw new TypeError(eg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Ko(r)}else e=Ko()}return t===void 0?i=p:i=c,Cr(i,"NAME","bernoulli"),r&&r.prng?(Cr(i,"seed",null),Cr(i,"seedLength",null),KE(i,"state",iR(null),rse),Cr(i,"stateLength",null),Cr(i,"byteLength",null),Cr(i,"toJSON",iR(null)),Cr(i,"PRNG",e)):($o(i,"seed",n),$o(i,"seedLength",a),KE(i,"state",g,d),$o(i,"stateLength",u),$o(i,"byteLength",o),Cr(i,"toJSON",m),Cr(i,"PRNG",e),e=e.normalized),i;function n(){return e.seed}function a(){return e.seedLength}function u(){return e.stateLength}function o(){return e.byteLength}function g(){return e.state}function d(y){e.state=y}function m(){var y={};return y.type="PRNG",y.name=i.NAME,y.state=ise(e.state),t===void 0?y.params=[]:y.params=[t],y}function c(){return e()<=t?1:0}function p(y){return tse(y)||y<0||y>1?NaN:e()<=y?1:0}}nR.exports=nse});var sR=s(function(RXe,aR){"use strict";var ase=Ec(),sse=ase();aR.exports=sse});var zs=s(function(PXe,oR){"use strict";var use=require("@stdlib/utils/define-nonenumerable-read-only-property"),uR=sR(),ose=Ec();use(uR,"factory",ose);oR.exports=uR});var fR=s(function(_Xe,vR){"use strict";var gse=require("@stdlib/assert/is-positive-integer").isPrimitive,vse=require("@stdlib/assert/is-probability").isPrimitive,gR=require("@stdlib/string/format");function fse(r,e){return gse(r)?vse(e)?null:new TypeError(gR("invalid argument. Second argument must be a probability. Value: `%s`.",e)):new TypeError(gR("invalid argument. First argument must be a positive integer. Value: `%s`.",e))}vR.exports=fse});var lR=s(function(TXe,dR){"use strict";function dse(r,e,i){var t=0,n;for(n=0;n=f?Ue=r()-.5:(Ue=I/f-.93,Ue=yse(Ue)*.5-Ue,I=f*r()),c=.5-Pc(Ue),S=Rc(Ue*(2*l/c+v)+h),!(S<0||S>e))if(I=I*t/(l/(c*c)+v),p=Pc(S-O),p>15){if(I=rg(I),o=p/u,g=(p/3+.625)*p,g+=bse,g/=u,o*=g+.5,Kd=-(p*p)/(2*u),IS)for(w=S;w<=O;w++)I*=m/w-W;if(I<=q)return S}}}hR.exports=wse});var bR=s(function(xXe,qR){"use strict";var Sse=lR(),Ose=pR();function yR(r,e,i){return i>.5?e-yR(r,e,1-i):e*i<10?Sse(r,e,i):Ose(r,e,i)}qR.exports=yR});var _c=s(function(GXe,PR){"use strict";var Br=require("@stdlib/utils/define-nonenumerable-read-only-property"),ig=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),SR=require("@stdlib/assert/is-plain-object"),OR=require("@stdlib/assert/is-function"),NR=require("@stdlib/assert/has-own-property"),LR=require("@stdlib/utils/constant-function"),Nse=require("@stdlib/utils/noop"),ER=require("@stdlib/math/base/assert/is-nan"),Lse=require("@stdlib/math/base/assert/is-positive-integer"),Ese=require("@stdlib/math/base/assert/is-probability"),ng=j().factory,Rse=require("@stdlib/array/to-json"),ag=require("@stdlib/string/format"),Pse=fR(),RR=bR();function _se(){var r,e,i,t,n,a;if(arguments.length===0)e=ng();else if(arguments.length===1){if(r=arguments[0],!SR(r))throw new TypeError(ag("invalid argument. Options argument must be an object. Value: `%s`.",r));if(NR(r,"prng")){if(!OR(r.prng))throw new TypeError(ag("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ng(r)}else{if(n=arguments[0],a=arguments[1],t=Pse(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!SR(r))throw new TypeError(ag("invalid argument. Options argument must be an object. Value: `%s`.",r));if(NR(r,"prng")){if(!OR(r.prng))throw new TypeError(ag("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ng(r)}else e=ng()}return n===void 0?i=f:i=y,Br(i,"NAME","binomial"),r&&r.prng?(Br(i,"seed",null),Br(i,"seedLength",null),wR(i,"state",LR(null),Nse),Br(i,"stateLength",null),Br(i,"byteLength",null),Br(i,"toJSON",LR(null)),Br(i,"PRNG",e)):(ig(i,"seed",u),ig(i,"seedLength",o),wR(i,"state",m,c),ig(i,"stateLength",g),ig(i,"byteLength",d),Br(i,"toJSON",p),Br(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function d(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function p(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=Rse(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return RR(e,n,a)}function f(l,v){return ER(l)||ER(v)||!Lse(l)||!Ese(v)?NaN:RR(e,l,v)}}PR.exports=_se});var TR=s(function(AXe,_R){"use strict";var Tse=_c(),jse=Tse();_R.exports=jse});var ks=s(function(VXe,MR){"use strict";var Mse=require("@stdlib/utils/define-nonenumerable-read-only-property"),jR=TR(),xse=_c();Mse(jR,"factory",xse);MR.exports=jR});var GR=s(function(FXe,xR){"use strict";var Gse=require("@stdlib/math/base/special/sqrt"),Ase=require("@stdlib/math/base/special/ln"),Vse=require("@stdlib/math/base/special/sin"),Fse=require("@stdlib/math/base/special/cos"),Wse=require("@stdlib/constants/float64/two-pi");function Ise(r){var e,i;return e=!0,t;function t(){var n,a,u,o;if(e){do n=r(),a=r();while(n===0);return u=Gse(-2*Ase(n)),o=Wse*a,i=u*Fse(o),e=!1,u*Vse(o)}return e=!0,i}}xR.exports=Ise});var VR=s(function(WXe,AR){"use strict";var zse=require("@stdlib/math/base/special/sqrt"),kse=require("@stdlib/math/base/special/ln"),Jse=require("@stdlib/math/base/special/cos"),Use=require("@stdlib/constants/float64/pi"),Cse=Jse(Use);function Bse(r){var e=zse(-2*kse(r));return e*Cse}AR.exports=Bse});var WR=s(function(IXe,FR){"use strict";var Xse=require("@stdlib/math/base/special/sqrt"),Dse=require("@stdlib/math/base/special/ln"),Yse=require("@stdlib/math/base/special/cos"),Hse=require("@stdlib/constants/float64/two-pi");function Zse(r){var e=Xse(-2*Dse(r)),i=Hse*r;return e*Yse(i)}FR.exports=Zse});var Tc=s(function(zXe,JR){"use strict";var $=require("@stdlib/utils/define-nonenumerable-read-only-property"),sg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),IR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Qse=require("@stdlib/assert/is-plain-object"),$se=require("@stdlib/assert/is-function"),Kse=require("@stdlib/assert/is-boolean").isPrimitive,Js=require("@stdlib/assert/has-own-property"),eue=require("@stdlib/assert/is-uint32array"),zR=j().factory,kR=require("@stdlib/utils/constant-function"),rue=require("@stdlib/utils/noop"),tue=require("@stdlib/array/to-json"),Us=require("@stdlib/string/format"),iue=GR(),nue=VR(),aue=WR();function sue(r){var e,i,t,n;if(n={copy:!0},arguments.length){if(!Qse(r))throw new TypeError(Us("invalid argument. Must provide an object. Value: `%s`.",r));if(Js(r,"copy")&&(n.copy=r.copy,!Kse(r.copy)))throw new TypeError(Us("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(Js(r,"prng")){if(!$se(r.prng))throw new TypeError(Us("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else if(Js(r,"state")){if(n.state=r.state,!eue(r.state))throw new TypeError(Us("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",r.state))}else if(Js(r,"seed")&&(n.seed=r.seed,r.seed===void 0))throw new TypeError(Us("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.","seed",r.seed))}return n.state===void 0?e===void 0?(t=zR(n),e=t.normalized):n.seed=null:(t=zR(n),e=t.normalized),i=iue(e),$(i,"NAME","box-muller"),n.seed===null?($(i,"seed",null),$(i,"seedLength",null)):(sg(i,"seed",a),sg(i,"seedLength",u)),r&&r.prng?(IR(i,"state",kR(null),rue),$(i,"stateLength",null),$(i,"byteLength",null),$(i,"toJSON",kR(null))):(IR(i,"state",d,m),sg(i,"stateLength",o),sg(i,"byteLength",g),$(i,"toJSON",c)),$(i,"PRNG",e),Js(e,"MIN")?($(i,"MIN",nue(e.MIN)),$(i,"MAX",aue(e.MIN))):($(i,"MIN",null),$(i,"MAX",null)),i;function a(){return t.seed}function u(){return t.seedLength}function o(){return t.stateLength}function g(){return t.byteLength}function d(){return t.state}function m(p){t.state=p}function c(){var p={};return p.type="PRNG",p.name=i.NAME,p.state=tue(t.state),p.params=[],p}}JR.exports=sue});var CR=s(function(kXe,UR){"use strict";var uue=Tc(),oue=uue();UR.exports=oue});var da=s(function(JXe,XR){"use strict";var gue=require("@stdlib/utils/define-nonenumerable-read-only-property"),BR=CR(),vue=Tc();gue(BR,"factory",vue);XR.exports=BR});var HR=s(function(UXe,YR){"use strict";var fue=require("@stdlib/assert/is-number").isPrimitive,due=require("@stdlib/assert/is-positive-number").isPrimitive,DR=require("@stdlib/string/format"),lue=require("@stdlib/assert/is-nan");function cue(r,e){return!fue(r)||lue(r)?new TypeError(DR("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):due(e)?null:new TypeError(DR("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}YR.exports=cue});var QR=s(function(CXe,ZR){"use strict";var mue=require("@stdlib/math/base/special/tan"),hue=require("@stdlib/constants/float64/pi");function pue(r,e,i){return e+i*mue(hue*(r()-.5))}ZR.exports=pue});var jc=s(function(BXe,aP){"use strict";var bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ug=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),$R=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),KR=require("@stdlib/assert/is-plain-object"),eP=require("@stdlib/assert/is-function"),rP=require("@stdlib/assert/has-own-property"),tP=require("@stdlib/utils/constant-function"),yue=require("@stdlib/utils/noop"),iP=require("@stdlib/math/base/assert/is-nan"),la=Y().factory,que=require("@stdlib/array/to-json"),og=require("@stdlib/string/format"),bue=HR(),nP=QR();function wue(){var r,e,i,t,n,a,u;if(arguments.length===0)e=la();else if(arguments.length===1){if(i=arguments[0],!KR(i))throw new TypeError(og("invalid argument. Options argument must be an object. Value: `%s`.",i));if(rP(i,"prng")){if(!eP(i.prng))throw new TypeError(og("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=la({prng:i.prng})}else e=la(i)}else{if(u=arguments[0],r=arguments[1],a=bue(u,r),a)throw a;if(arguments.length>2){if(i=arguments[2],!KR(i))throw new TypeError(og("invalid argument. Options argument must be an object. Value: `%s`.",i));if(rP(i,"prng")){if(!eP(i.prng))throw new TypeError(og("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=la({prng:i.prng})}else e=la(i)}else e=la()}return u===void 0?n=l:n=f,t=e.PRNG,bt(n,"NAME","cauchy"),i&&i.prng?(bt(n,"seed",null),bt(n,"seedLength",null),$R(n,"state",tP(null),yue),bt(n,"stateLength",null),bt(n,"byteLength",null),bt(n,"toJSON",tP(null))):(ug(n,"seed",o),ug(n,"seedLength",g),$R(n,"state",c,p),ug(n,"stateLength",d),ug(n,"byteLength",m),bt(n,"toJSON",y)),bt(n,"PRNG",t),n;function o(){return t.seed}function g(){return t.seedLength}function d(){return t.stateLength}function m(){return t.byteLength}function c(){return t.state}function p(v){t.state=v}function y(){var v={};return v.type="PRNG",v.name=n.NAME,v.state=que(t.state),u===void 0?v.params=[]:v.params=[u,r],v}function f(){return nP(e,u,r)}function l(v,h){return iP(v)||iP(h)||h<=0?NaN:nP(e,v,h)}}aP.exports=wue});var uP=s(function(XXe,sP){"use strict";var Sue=jc(),Oue=Sue();sP.exports=Oue});var Cs=s(function(DXe,gP){"use strict";var Nue=require("@stdlib/utils/define-nonenumerable-read-only-property"),oP=uP(),Lue=jc();Nue(oP,"factory",Lue);gP.exports=oP});var Mc=s(function(YXe,mP){"use strict";var wt=require("@stdlib/utils/define-nonenumerable-read-only-property"),gg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),vP=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Eue=require("@stdlib/assert/is-positive-number").isPrimitive,fP=require("@stdlib/assert/is-plain-object"),dP=require("@stdlib/assert/is-function"),lP=require("@stdlib/assert/has-own-property"),cP=require("@stdlib/utils/constant-function"),Rue=require("@stdlib/utils/noop"),Pue=require("@stdlib/math/base/assert/is-nan"),ca=ze().factory,_ue=require("@stdlib/array/to-json"),vg=require("@stdlib/string/format");function Tue(){var r,e,i,t,n;if(arguments.length===0)r=ca();else if(arguments.length===1&&fP(arguments[0]))if(i=arguments[0],lP(i,"prng")){if(!dP(i.prng))throw new TypeError(vg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=ca({prng:i.prng})}else r=ca(i);else{if(n=arguments[0],!Eue(n))throw new TypeError(vg("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(i=arguments[1],!fP(i))throw new TypeError(vg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(lP(i,"prng")){if(!dP(i.prng))throw new TypeError(vg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=ca(n/2,.5,{prng:i.prng})}else r=ca(n/2,.5,i)}else r=ca(n/2,.5)}return n===void 0?t=y:t=p,e=r.PRNG,wt(t,"NAME","chisquare"),i&&i.prng?(wt(t,"seed",null),wt(t,"seedLength",null),vP(t,"state",cP(null),Rue),wt(t,"stateLength",null),wt(t,"byteLength",null),wt(t,"toJSON",cP(null))):(gg(t,"seed",a),gg(t,"seedLength",u),vP(t,"state",d,m),gg(t,"stateLength",o),gg(t,"byteLength",g),wt(t,"toJSON",c)),wt(t,"PRNG",e),t;function a(){return e.seed}function u(){return e.seedLength}function o(){return e.stateLength}function g(){return e.byteLength}function d(){return e.state}function m(f){e.state=f}function c(){var f={};return f.type="PRNG",f.name=t.NAME,f.state=_ue(e.state),n===void 0?f.params=[]:f.params=[n],f}function p(){return r()}function y(f){return Pue(f)||f<=0?NaN:r(f/2,.5)}}mP.exports=Tue});var pP=s(function(HXe,hP){"use strict";var jue=Mc(),Mue=jue();hP.exports=Mue});var St=s(function(ZXe,qP){"use strict";var xue=require("@stdlib/utils/define-nonenumerable-read-only-property"),yP=pP(),Gue=Mc();xue(yP,"factory",Gue);qP.exports=yP});var xc=s(function(QXe,EP){"use strict";var Ot=require("@stdlib/utils/define-nonenumerable-read-only-property"),fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bP=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Aue=require("@stdlib/assert/is-positive-number").isPrimitive,wP=require("@stdlib/assert/is-plain-object"),SP=require("@stdlib/assert/is-function"),OP=require("@stdlib/assert/has-own-property"),NP=require("@stdlib/utils/constant-function"),Vue=require("@stdlib/utils/noop"),Fue=require("@stdlib/math/base/assert/is-nan"),ma=St().factory,Wue=require("@stdlib/array/to-json"),LP=require("@stdlib/math/base/special/sqrt"),dg=require("@stdlib/string/format");function Iue(){var r,e,i,t,n;if(arguments.length===0)r=ma();else if(arguments.length===1&&wP(arguments[0]))if(i=arguments[0],OP(i,"prng")){if(!SP(i.prng))throw new TypeError(dg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=ma({prng:i.prng})}else r=ma(i);else{if(n=arguments[0],!Aue(n))throw new TypeError(dg("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(i=arguments[1],!wP(i))throw new TypeError(dg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(OP(i,"prng")){if(!SP(i.prng))throw new TypeError(dg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=ma(n,{prng:i.prng})}else r=ma(n,i)}else r=ma(n)}return n===void 0?t=y:t=p,e=r.PRNG,Ot(t,"NAME","chi"),i&&i.prng?(Ot(t,"seed",null),Ot(t,"seedLength",null),bP(t,"state",NP(null),Vue),Ot(t,"stateLength",null),Ot(t,"byteLength",null),Ot(t,"toJSON",NP(null))):(fg(t,"seed",a),fg(t,"seedLength",u),bP(t,"state",d,m),fg(t,"stateLength",o),fg(t,"byteLength",g),Ot(t,"toJSON",c)),Ot(t,"PRNG",e),t;function a(){return e.seed}function u(){return e.seedLength}function o(){return e.stateLength}function g(){return e.byteLength}function d(){return e.state}function m(f){e.state=f}function c(){var f={};return f.type="PRNG",f.name=t.NAME,f.state=Wue(e.state),n===void 0?f.params=[]:f.params=[n],f}function p(){return LP(r())}function y(f){return Fue(f)||f<=0?NaN:LP(r(f))}}EP.exports=Iue});var PP=s(function($Xe,RP){"use strict";var zue=xc(),kue=zue();RP.exports=kue});var Bs=s(function(KXe,TP){"use strict";var Jue=require("@stdlib/utils/define-nonenumerable-read-only-property"),_P=PP(),Uue=xc();Jue(_P,"factory",Uue);TP.exports=_P});var xP=s(function(e7e,MP){"use strict";var Cue=require("@stdlib/assert/is-positive-number").isPrimitive,Bue=require("@stdlib/assert/is-positive-integer").isPrimitive,jP=require("@stdlib/string/format");function Xue(r,e){return Bue(r)?Cue(e)?null:new TypeError(jP("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(jP("invalid argument. First argument must be a positive integer. Value: `%s`.",r))}MP.exports=Xue});var AP=s(function(r7e,GP){"use strict";var Due=require("@stdlib/math/base/special/ln");function Yue(r,e,i){var t,n;for(t=1,n=0;n2){if(i=arguments[2],!FP(i))throw new TypeError(mg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(IP(i,"prng")){if(!WP(i.prng))throw new TypeError(mg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=i.prng}else e=cg(i)}else e=cg()}return a===void 0?t=f:t=y,Xr(t,"NAME","erlang"),i&&i.prng?(Xr(t,"seed",null),Xr(t,"seedLength",null),VP(t,"state",zP(null),Hue),Xr(t,"stateLength",null),Xr(t,"byteLength",null),Xr(t,"toJSON",zP(null)),Xr(t,"PRNG",e)):(lg(t,"seed",u),lg(t,"seedLength",o),VP(t,"state",m,c),lg(t,"stateLength",g),lg(t,"byteLength",d),Xr(t,"toJSON",p),Xr(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function d(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function p(){var l={};return l.type="PRNG",l.name=t.NAME,l.state=Que(e.state),a===void 0?l.params=[]:l.params=[a,r],l}function y(){return JP(e,a,r)}function f(l,v){return kP(l)||kP(v)||!Zue(l)||v<=0?NaN:JP(e,l,v)}}UP.exports=Kue});var BP=s(function(i7e,CP){"use strict";var eoe=Gc(),roe=eoe();CP.exports=roe});var Xs=s(function(n7e,DP){"use strict";var toe=require("@stdlib/utils/define-nonenumerable-read-only-property"),XP=BP(),ioe=Gc();toe(XP,"factory",ioe);DP.exports=XP});var QP=s(function(a7e,ZP){"use strict";var YP=require("@stdlib/assert/is-positive-number").isPrimitive,HP=require("@stdlib/string/format");function noe(r,e){return YP(r)?YP(e)?null:new TypeError(HP("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(HP("invalid argument. First argument must be a positive number. Value: `%s`.",r))}ZP.exports=noe});var KP=s(function(s7e,$P){"use strict";function aoe(r,e,i){var t=r(e)/e,n=r(i)/i;return t/n}$P.exports=aoe});var Ac=s(function(u7e,u_){"use strict";var Nt=require("@stdlib/utils/define-nonenumerable-read-only-property"),hg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),e_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),r_=require("@stdlib/assert/is-plain-object"),t_=require("@stdlib/assert/is-function"),i_=require("@stdlib/assert/has-own-property"),n_=require("@stdlib/utils/constant-function"),soe=require("@stdlib/utils/noop"),ha=St().factory,a_=require("@stdlib/math/base/assert/is-nan"),uoe=require("@stdlib/array/to-json"),pg=require("@stdlib/string/format"),ooe=QP(),s_=KP();function goe(){var r,e,i,t,n,a,u;if(arguments.length===0)r=ha();else if(arguments.length===1){if(e=arguments[0],!r_(e))throw new TypeError(pg("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i_(e,"prng")){if(!t_(e.prng))throw new TypeError(pg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=ha({prng:e.prng})}else r=ha(e)}else{if(a=arguments[0],u=arguments[1],n=ooe(a,u),n)throw n;if(arguments.length>2){if(e=arguments[2],!r_(e))throw new TypeError(pg("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i_(e,"prng")){if(!t_(e.prng))throw new TypeError(pg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=ha({prng:e.prng})}else r=ha(e)}else r=ha()}return a===void 0?t=l:t=f,i=r.PRNG,Nt(t,"NAME","f"),e&&e.prng?(Nt(t,"seed",null),Nt(t,"seedLength",null),e_(t,"state",n_(null),soe),Nt(t,"stateLength",null),Nt(t,"byteLength",null),Nt(t,"toJSON",n_(null))):(hg(t,"seed",o),hg(t,"seedLength",g),e_(t,"state",c,p),hg(t,"stateLength",d),hg(t,"byteLength",m),Nt(t,"toJSON",y)),Nt(t,"PRNG",i),t;function o(){return i.seed}function g(){return i.seedLength}function d(){return i.stateLength}function m(){return i.byteLength}function c(){return i.state}function p(v){i.state=v}function y(){var v={};return v.type="PRNG",v.name=t.NAME,v.state=uoe(i.state),a===void 0?v.params=[]:v.params=[a,u],v}function f(){return s_(r,a,u)}function l(v,h){return a_(v)||a_(h)||v<=0||h<=0?NaN:s_(r,v,h)}}u_.exports=goe});var g_=s(function(o7e,o_){"use strict";var voe=Ac(),foe=voe();o_.exports=foe});var Ds=s(function(g7e,f_){"use strict";var doe=require("@stdlib/utils/define-nonenumerable-read-only-property"),v_=g_(),loe=Ac();doe(v_,"factory",loe);f_.exports=v_});var c_=s(function(v7e,l_){"use strict";var d_=require("@stdlib/assert/is-positive-number").isPrimitive,coe=require("@stdlib/assert/is-number").isPrimitive,Vc=require("@stdlib/assert/is-nan"),Fc=require("@stdlib/string/format");function moe(r,e,i){return!d_(r)||Vc(r)?new TypeError(Fc("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r)):!d_(e)||Vc(e)?new TypeError(Fc("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e)):!coe(i)||Vc(i)?new TypeError(Fc("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",i)):null}l_.exports=moe});var h_=s(function(f7e,m_){"use strict";var hoe=require("@stdlib/math/base/special/pow"),poe=require("@stdlib/math/base/special/ln");function yoe(r,e,i,t){return t+i*hoe(-poe(r()),-1/e)}m_.exports=yoe});var Ic=s(function(d7e,O_){"use strict";var Dr=require("@stdlib/utils/define-nonenumerable-read-only-property"),yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),p_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),y_=require("@stdlib/assert/is-plain-object"),q_=require("@stdlib/assert/is-function"),b_=require("@stdlib/assert/has-own-property"),w_=require("@stdlib/utils/constant-function"),qoe=require("@stdlib/utils/noop"),qg=j().factory,Wc=require("@stdlib/math/base/assert/is-nan"),boe=require("@stdlib/array/to-json"),bg=require("@stdlib/string/format"),woe=c_(),S_=h_();function Soe(){var r,e,i,t,n,a,u;if(arguments.length===0)i=qg();else if(arguments.length===1){if(e=arguments[0],!y_(e))throw new TypeError(bg("invalid argument. Options argument must be an object. Value: `%s`.",e));if(b_(e,"prng")){if(!q_(e.prng))throw new TypeError(bg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=qg(e)}else{if(r=arguments[0],a=arguments[1],u=arguments[2],n=woe(r,a,u),n)throw n;if(arguments.length>3){if(e=arguments[3],!y_(e))throw new TypeError(bg("invalid argument. Options argument must be an object. Value: `%s`.",e));if(b_(e,"prng")){if(!q_(e.prng))throw new TypeError(bg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=qg(e)}else i=qg()}return r===void 0?t=l:t=f,Dr(t,"NAME","frechet"),e&&e.prng?(Dr(t,"seed",null),Dr(t,"seedLength",null),p_(t,"state",w_(null),qoe),Dr(t,"stateLength",null),Dr(t,"byteLength",null),Dr(t,"toJSON",w_(null)),Dr(t,"PRNG",i)):(yg(t,"seed",o),yg(t,"seedLength",g),p_(t,"state",c,p),yg(t,"stateLength",d),yg(t,"byteLength",m),Dr(t,"toJSON",y),Dr(t,"PRNG",i),i=i.normalized),t;function o(){return i.seed}function g(){return i.seedLength}function d(){return i.stateLength}function m(){return i.byteLength}function c(){return i.state}function p(v){i.state=v}function y(){var v={};return v.type="PRNG",v.name=t.NAME,v.state=boe(i.state),r===void 0?v.params=[]:v.params=[r,a,u],v}function f(){return S_(i,r,a,u)}function l(v,h,q){return Wc(v)||Wc(h)||Wc(q)||v<=0||h<=0?NaN:S_(i,v,h,q)}}O_.exports=Soe});var L_=s(function(l7e,N_){"use strict";var Ooe=Ic(),Noe=Ooe();N_.exports=Noe});var Ys=s(function(c7e,R_){"use strict";var Loe=require("@stdlib/utils/define-nonenumerable-read-only-property"),E_=L_(),Eoe=Ic();Loe(E_,"factory",Eoe);R_.exports=E_});var T_=s(function(m7e,__){"use strict";var Roe=require("@stdlib/assert/is-number").isPrimitive,Poe=require("@stdlib/assert/is-positive-number").isPrimitive,P_=require("@stdlib/string/format"),_oe=require("@stdlib/assert/is-nan");function Toe(r,e){return!Roe(r)||_oe(r)?new TypeError(P_("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Poe(e)?null:new TypeError(P_("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}__.exports=Toe});var x_=s(function(h7e,M_){"use strict";var j_=require("@stdlib/math/base/special/ln");function joe(r,e,i){return e-i*j_(-j_(r()))}M_.exports=joe});var zc=s(function(p7e,k_){"use strict";var Yr=require("@stdlib/utils/define-nonenumerable-read-only-property"),wg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),G_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),A_=require("@stdlib/assert/is-plain-object"),V_=require("@stdlib/assert/is-function"),F_=require("@stdlib/assert/has-own-property"),W_=require("@stdlib/utils/constant-function"),Moe=require("@stdlib/utils/noop"),Sg=j().factory,I_=require("@stdlib/math/base/assert/is-nan"),xoe=require("@stdlib/array/to-json"),Og=require("@stdlib/string/format"),Goe=T_(),z_=x_();function Aoe(){var r,e,i,t,n,a;if(arguments.length===0)i=Sg();else if(arguments.length===1){if(e=arguments[0],!A_(e))throw new TypeError(Og("invalid argument. Options argument must be an object. Value: `%s`.",e));if(F_(e,"prng")){if(!V_(e.prng))throw new TypeError(Og("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=Sg(e)}else{if(a=arguments[0],r=arguments[1],n=Goe(a,r),n)throw n;if(arguments.length>2){if(e=arguments[2],!A_(e))throw new TypeError(Og("invalid argument. Options argument must be an object. Value: `%s`.",e));if(F_(e,"prng")){if(!V_(e.prng))throw new TypeError(Og("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=Sg(e)}else i=Sg()}return a===void 0?t=f:t=y,Yr(t,"NAME","gumbel"),e&&e.prng?(Yr(t,"seed",null),Yr(t,"seedLength",null),G_(t,"state",W_(null),Moe),Yr(t,"stateLength",null),Yr(t,"byteLength",null),Yr(t,"toJSON",W_(null)),Yr(t,"PRNG",i)):(wg(t,"seed",u),wg(t,"seedLength",o),G_(t,"state",m,c),wg(t,"stateLength",g),wg(t,"byteLength",d),Yr(t,"toJSON",p),Yr(t,"PRNG",i),i=i.normalized),t;function u(){return i.seed}function o(){return i.seedLength}function g(){return i.stateLength}function d(){return i.byteLength}function m(){return i.state}function c(l){i.state=l}function p(){var l={};return l.type="PRNG",l.name=t.NAME,l.state=xoe(i.state),a===void 0?l.params=[]:l.params=[a,r],l}function y(){return z_(i,a,r)}function f(l,v){return I_(l)||I_(v)||v<=0?NaN:z_(i,l,v)}}k_.exports=Aoe});var U_=s(function(y7e,J_){"use strict";var Voe=zc(),Foe=Voe();J_.exports=Foe});var Hs=s(function(q7e,B_){"use strict";var Woe=require("@stdlib/utils/define-nonenumerable-read-only-property"),C_=U_(),Ioe=zc();Woe(C_,"factory",Ioe);B_.exports=C_});var D_=s(function(b7e,X_){"use strict";var kc=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zs=require("@stdlib/string/format");function zoe(r,e,i){return kc(r)?kc(e)?kc(i)?i>r?new RangeError(Zs("invalid argument. Third argument must be less than or equal to the first argument. Value: `%u`.",i)):e>r?new RangeError(Zs("invalid argument. Second argument must be less than or equal to the first argument. Value: `%u`.",e)):null:new TypeError(Zs("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",i)):new TypeError(Zs("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e)):new TypeError(Zs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r))}X_.exports=zoe});var H_=s(function(w7e,Y_){"use strict";var Lt=require("@stdlib/math/base/special/factorial");function koe(r,e,i,t){var n,a,u;for(tn;)a-=n,n*=(e-u)*(t-u)/((u+1)*(i-t+1+u)),u+=1;return u}Y_.exports=koe});var Q_=s(function(S7e,Z_){"use strict";var Ng=H_();function Joe(r,e,i,t){var n,a,u,o;return t>e/2?(u=e-t,2*i<=e?(n=i,a=e-i,o=Ng(r,n,a,u),i-o):(a=i,n=e-i,o=Ng(r,n,a,u),t-e+i+o)):(u=t,2*i<=e?(n=i,a=e-i,o=Ng(r,n,a,u),o):(n=e-i,a=i,o=Ng(r,n,a,u),t-o))}Z_.exports=Joe});var Uc=s(function(O7e,aT){"use strict";var Hr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),$_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),K_=require("@stdlib/assert/is-plain-object"),eT=require("@stdlib/assert/is-function"),rT=require("@stdlib/assert/has-own-property"),tT=require("@stdlib/utils/constant-function"),Uoe=require("@stdlib/utils/noop"),Eg=j().factory,Jc=require("@stdlib/math/base/assert/is-nonnegative-integer"),iT=require("@stdlib/constants/float64/pinf"),Coe=require("@stdlib/array/to-json"),Rg=require("@stdlib/string/format"),Boe=D_(),nT=Q_();function Xoe(){var r,e,i,t,n,a,u;if(arguments.length===0)e=Eg();else if(arguments.length===1){if(r=arguments[0],!K_(r))throw new TypeError(Rg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(rT(r,"prng")){if(!eT(r.prng))throw new TypeError(Rg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Eg(r)}else{if(n=arguments[0],a=arguments[1],u=arguments[2],t=Boe(n,a,u),t)throw t;if(arguments.length>3){if(r=arguments[3],!K_(r))throw new TypeError(Rg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(rT(r,"prng")){if(!eT(r.prng))throw new TypeError(Rg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Eg(r)}else e=Eg()}return n===void 0?i=l:i=f,Hr(i,"NAME","hypergeometric"),r&&r.prng?(Hr(i,"seed",null),Hr(i,"seedLength",null),$_(i,"state",tT(null),Uoe),Hr(i,"stateLength",null),Hr(i,"byteLength",null),Hr(i,"toJSON",tT(null)),Hr(i,"PRNG",e)):(Lg(i,"seed",o),Lg(i,"seedLength",g),$_(i,"state",c,p),Lg(i,"stateLength",d),Lg(i,"byteLength",m),Hr(i,"toJSON",y),Hr(i,"PRNG",e),e=e.normalized),i;function o(){return e.seed}function g(){return e.seedLength}function d(){return e.stateLength}function m(){return e.byteLength}function c(){return e.state}function p(v){e.state=v}function y(){var v={};return v.type="PRNG",v.name=i.NAME,v.state=Coe(e.state),n===void 0?v.params=[]:v.params=[n,a,u],v}function f(){return nT(e,n,a,u)}function l(v,h,q){return v===iT||h===iT||!Jc(v)||!Jc(h)||!Jc(q)||q>v?NaN:nT(e,v,h,q)}}aT.exports=Xoe});var uT=s(function(N7e,sT){"use strict";var Doe=Uc(),Yoe=Doe();sT.exports=Yoe});var Qs=s(function(L7e,gT){"use strict";var Hoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),oT=uT(),Zoe=Uc();Hoe(oT,"factory",Zoe);gT.exports=oT});var lT=s(function(E7e,dT){"use strict";var vT=require("@stdlib/assert/is-positive-number").isPrimitive,fT=require("@stdlib/string/format");function Qoe(r,e){return vT(r)?vT(e)?null:new TypeError(fT("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(fT("invalid argument. First argument must be a positive number. Value: `%s`.",r))}dT.exports=Qoe});var hT=s(function(R7e,mT){"use strict";var cT=require("@stdlib/math/base/special/pow");function $oe(r,e,i){var t=r();return cT(1-cT(1-t,1/i),1/e)}mT.exports=$oe});var Cc=s(function(P7e,NT){"use strict";var Zr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),yT=require("@stdlib/assert/is-plain-object"),qT=require("@stdlib/assert/is-function"),bT=require("@stdlib/assert/has-own-property"),wT=require("@stdlib/utils/constant-function"),Koe=require("@stdlib/utils/noop"),_g=j().factory,ST=require("@stdlib/math/base/assert/is-nan"),ege=require("@stdlib/array/to-json"),Tg=require("@stdlib/string/format"),rge=lT(),OT=hT();function tge(){var r,e,i,t,n,a;if(arguments.length===0)e=_g();else if(arguments.length===1){if(r=arguments[0],!yT(r))throw new TypeError(Tg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(bT(r,"prng")){if(!qT(r.prng))throw new TypeError(Tg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=_g(r)}else{if(n=arguments[0],a=arguments[1],t=rge(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!yT(r))throw new TypeError(Tg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(bT(r,"prng")){if(!qT(r.prng))throw new TypeError(Tg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=_g(r)}else e=_g()}return n===void 0?i=f:i=y,Zr(i,"NAME","kumaraswamy"),r&&r.prng?(Zr(i,"seed",null),Zr(i,"seedLength",null),pT(i,"state",wT(null),Koe),Zr(i,"stateLength",null),Zr(i,"byteLength",null),Zr(i,"toJSON",wT(null)),Zr(i,"PRNG",e)):(Pg(i,"seed",u),Pg(i,"seedLength",o),pT(i,"state",m,c),Pg(i,"stateLength",g),Pg(i,"byteLength",d),Zr(i,"toJSON",p),Zr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function d(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function p(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=ege(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return OT(e,n,a)}function f(l,v){return ST(l)||ST(v)||l<=0||v<=0?NaN:OT(e,l,v)}}NT.exports=tge});var ET=s(function(_7e,LT){"use strict";var ige=Cc(),nge=ige();LT.exports=nge});var $s=s(function(T7e,PT){"use strict";var age=require("@stdlib/utils/define-nonenumerable-read-only-property"),RT=ET(),sge=Cc();age(RT,"factory",sge);PT.exports=RT});var jT=s(function(j7e,TT){"use strict";var uge=require("@stdlib/assert/is-number").isPrimitive,oge=require("@stdlib/assert/is-positive-number").isPrimitive,_T=require("@stdlib/string/format"),gge=require("@stdlib/assert/is-nan");function vge(r,e){return!uge(r)||gge(r)?new TypeError(_T("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):oge(e)?null:new TypeError(_T("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}TT.exports=vge});var xT=s(function(M7e,MT){"use strict";var fge=require("@stdlib/math/base/special/signum"),dge=require("@stdlib/math/base/special/abs"),lge=require("@stdlib/math/base/special/ln");function cge(r,e,i){var t=r()-.5;return e-i*fge(t)*lge(1-2*dge(t))}MT.exports=cge});var Bc=s(function(x7e,kT){"use strict";var Qr=require("@stdlib/utils/define-nonenumerable-read-only-property"),jg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),GT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),AT=require("@stdlib/assert/is-plain-object"),VT=require("@stdlib/assert/is-function"),FT=require("@stdlib/assert/has-own-property"),WT=require("@stdlib/utils/constant-function"),mge=require("@stdlib/utils/noop"),Mg=j().factory,IT=require("@stdlib/math/base/assert/is-nan"),hge=require("@stdlib/array/to-json"),xg=require("@stdlib/string/format"),pge=jT(),zT=xT();function yge(){var r,e,i,t,n,a;if(arguments.length===0)e=Mg();else if(arguments.length===1){if(r=arguments[0],!AT(r))throw new TypeError(xg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(FT(r,"prng")){if(!VT(r.prng))throw new TypeError(xg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Mg(r)}else{if(n=arguments[0],a=arguments[1],t=pge(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!AT(r))throw new TypeError(xg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(FT(r,"prng")){if(!VT(r.prng))throw new TypeError(xg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Mg(r)}else e=Mg()}return n===void 0?i=f:i=y,Qr(i,"NAME","laplace"),r&&r.prng?(Qr(i,"seed",null),Qr(i,"seedLength",null),GT(i,"state",WT(null),mge),Qr(i,"stateLength",null),Qr(i,"byteLength",null),Qr(i,"toJSON",WT(null)),Qr(i,"PRNG",e)):(jg(i,"seed",u),jg(i,"seedLength",o),GT(i,"state",m,c),jg(i,"stateLength",g),jg(i,"byteLength",d),Qr(i,"toJSON",p),Qr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function d(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function p(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=hge(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return zT(e,n,a)}function f(l,v){return IT(l)||IT(v)||v<=0?NaN:zT(e,l,v)}}kT.exports=yge});var UT=s(function(G7e,JT){"use strict";var qge=Bc(),bge=qge();JT.exports=bge});var Ks=s(function(A7e,BT){"use strict";var wge=require("@stdlib/utils/define-nonenumerable-read-only-property"),CT=UT(),Sge=Bc();wge(CT,"factory",Sge);BT.exports=CT});var YT=s(function(V7e,DT){"use strict";var Oge=require("@stdlib/assert/is-number").isPrimitive,Nge=require("@stdlib/assert/is-positive-number").isPrimitive,XT=require("@stdlib/string/format"),Lge=require("@stdlib/assert/is-nan");function Ege(r,e){return!Oge(r)||Lge(r)?new TypeError(XT("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Nge(e)?null:new TypeError(XT("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}DT.exports=Ege});var ZT=s(function(F7e,HT){"use strict";var Rge=require("@stdlib/stats/base/dists/normal/quantile");function Pge(r,e,i){var t=Rge(1-r()/2,0,1);return e+i/(t*t)}HT.exports=Pge});var Xc=s(function(W7e,n0){"use strict";var $r=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),QT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$T=require("@stdlib/assert/is-plain-object"),KT=require("@stdlib/assert/is-function"),e0=require("@stdlib/assert/has-own-property"),r0=require("@stdlib/utils/constant-function"),_ge=require("@stdlib/utils/noop"),Ag=j().factory,t0=require("@stdlib/math/base/assert/is-nan"),Tge=require("@stdlib/array/to-json"),Vg=require("@stdlib/string/format"),jge=YT(),i0=ZT();function Mge(){var r,e,i,t,n,a;if(arguments.length===0)e=Ag();else if(arguments.length===1){if(r=arguments[0],!$T(r))throw new TypeError(Vg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e0(r,"prng")){if(!KT(r.prng))throw new TypeError(Vg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Ag(r)}else{if(n=arguments[0],a=arguments[1],t=jge(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!$T(r))throw new TypeError(Vg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e0(r,"prng")){if(!KT(r.prng))throw new TypeError(Vg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Ag(r)}else e=Ag()}return n===void 0?i=f:i=y,$r(i,"NAME","levy"),r&&r.prng?($r(i,"seed",null),$r(i,"seedLength",null),QT(i,"state",r0(null),_ge),$r(i,"stateLength",null),$r(i,"byteLength",null),$r(i,"toJSON",r0(null)),$r(i,"PRNG",e)):(Gg(i,"seed",u),Gg(i,"seedLength",o),QT(i,"state",m,c),Gg(i,"stateLength",g),Gg(i,"byteLength",d),$r(i,"toJSON",p),$r(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function d(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function p(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=Tge(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return i0(e,n,a)}function f(l,v){return t0(l)||t0(v)||v<=0?NaN:i0(e,l,v)}}n0.exports=Mge});var s0=s(function(I7e,a0){"use strict";var xge=Xc(),Gge=xge();a0.exports=Gge});var eu=s(function(z7e,o0){"use strict";var Age=require("@stdlib/utils/define-nonenumerable-read-only-property"),u0=s0(),Vge=Xc();Age(u0,"factory",Vge);o0.exports=u0});var f0=s(function(k7e,v0){"use strict";var Fge=require("@stdlib/assert/is-number").isPrimitive,Wge=require("@stdlib/assert/is-positive-number").isPrimitive,Ige=require("@stdlib/assert/is-nan"),g0=require("@stdlib/string/format");function zge(r,e){return!Fge(r)||Ige(r)?new TypeError(g0("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Wge(e)?null:new TypeError(g0("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}v0.exports=zge});var l0=s(function(J7e,d0){"use strict";var kge=require("@stdlib/math/base/special/ln");function Jge(r,e,i){var t=r();return e+i*kge(t/(1-t))}d0.exports=Jge});var Dc=s(function(U7e,w0){"use strict";var Kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),c0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),m0=require("@stdlib/assert/is-plain-object"),h0=require("@stdlib/assert/is-function"),p0=require("@stdlib/assert/has-own-property"),y0=require("@stdlib/utils/constant-function"),Uge=require("@stdlib/utils/noop"),Wg=j().factory,q0=require("@stdlib/math/base/assert/is-nan"),Cge=require("@stdlib/array/to-json"),Ig=require("@stdlib/string/format"),Bge=f0(),b0=l0();function Xge(){var r,e,i,t,n,a;if(arguments.length===0)e=Wg();else if(arguments.length===1){if(r=arguments[0],!m0(r))throw new TypeError(Ig("invalid argument. Options argument must be an object. Value: `%s`.",r));if(p0(r,"prng")){if(!h0(r.prng))throw new TypeError(Ig("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Wg(r)}else{if(n=arguments[0],a=arguments[1],t=Bge(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!m0(r))throw new TypeError(Ig("invalid argument. Options argument must be an object. Value: `%s`.",r));if(p0(r,"prng")){if(!h0(r.prng))throw new TypeError(Ig("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Wg(r)}else e=Wg()}return n===void 0?i=f:i=y,Kr(i,"NAME","logistic"),r&&r.prng?(Kr(i,"seed",null),Kr(i,"seedLength",null),c0(i,"state",y0(null),Uge),Kr(i,"stateLength",null),Kr(i,"byteLength",null),Kr(i,"toJSON",y0(null)),Kr(i,"PRNG",e)):(Fg(i,"seed",u),Fg(i,"seedLength",o),c0(i,"state",m,c),Fg(i,"stateLength",g),Fg(i,"byteLength",d),Kr(i,"toJSON",p),Kr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function d(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function p(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=Cge(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return b0(e,n,a)}function f(l,v){return q0(l)||q0(v)||v<=0?NaN:b0(e,l,v)}}w0.exports=Xge});var O0=s(function(C7e,S0){"use strict";var Dge=Dc(),Yge=Dge();S0.exports=Yge});var ru=s(function(B7e,L0){"use strict";var Hge=require("@stdlib/utils/define-nonenumerable-read-only-property"),N0=O0(),Zge=Dc();Hge(N0,"factory",Zge);L0.exports=N0});var R0=s(function(X7e,E0){"use strict";var Qge=require("@stdlib/math/base/special/exp");function $ge(r,e){for(var i=r(),t=1;i>Qge(-e);)t+=1,i*=r();return t-1}E0.exports=$ge});var j0=s(function(D7e,T0){"use strict";var Kge=require("@stdlib/math/base/special/factorialln"),P0=require("@stdlib/math/base/special/floor"),eve=require("@stdlib/math/base/special/signum"),rve=require("@stdlib/math/base/special/sqrt"),_0=require("@stdlib/math/base/special/abs"),zg=require("@stdlib/math/base/special/ln"),tve=require("@stdlib/constants/float64/ln-sqrt-two-pi"),ive=1/12,nve=1/360;function ave(r,e){var i,t,n,a,u,o,g,d,m,c;for(i=rve(e),g=2.53*i+.931,o=.02483*g-.059,t=1.1328/(g-3.4)+1.1239,u=-3.6224/(g-2)+.9277,n=.86*u;;){if(c=r(),c<=n)return m=c/u-.43,m*=2*o/(.5-_0(m))+g,m+=e+.445,P0(m);if(c>=u?m=r()-.5:(m=c/u-.93,m=eve(m)*.5-m,c=u*r()),a=.5-_0(m),(a>=.013||a>=c)&&(d=P0((2*o/a+g)*m+e+.445),c*=t/(o/(a*a)+g),m=(d+.5)*zg(e/d),m+=-e-tve+d,m-=(ive-nve/(d*d))/d,d>=10&&m>=zg(c*i)||(m=d*zg(e)-e-Kge(d),d>=0&&d<=9&&m>=zg(c))))return d}}T0.exports=ave});var x0=s(function(Y7e,M0){"use strict";var sve=R0(),uve=j0();function ove(r,e){return e<30?sve(r,e):uve(r,e)}M0.exports=ove});var Yc=s(function(H7e,z0){"use strict";var et=require("@stdlib/utils/define-nonenumerable-read-only-property"),kg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),G0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gve=require("@stdlib/assert/is-positive-number").isPrimitive,A0=require("@stdlib/assert/is-plain-object"),V0=require("@stdlib/assert/is-function"),F0=require("@stdlib/assert/has-own-property"),W0=require("@stdlib/utils/constant-function"),vve=require("@stdlib/utils/noop"),Jg=j().factory,fve=require("@stdlib/math/base/assert/is-nan"),dve=require("@stdlib/array/to-json"),Ug=require("@stdlib/string/format"),I0=x0();function lve(){var r,e,i,t;if(arguments.length===0)i=Jg();else if(arguments.length===1&&A0(arguments[0]))if(e=arguments[0],F0(e,"prng")){if(!V0(e.prng))throw new TypeError(Ug("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=Jg(e);else{if(r=arguments[0],!gve(r))throw new TypeError(Ug("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!A0(e))throw new TypeError(Ug("invalid argument. Options argument must be an object. Value: `%s`.",e));if(F0(e,"prng")){if(!V0(e.prng))throw new TypeError(Ug("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=Jg(e)}else i=Jg()}return r===void 0?t=p:t=c,et(t,"NAME","poisson"),e&&e.prng?(et(t,"seed",null),et(t,"seedLength",null),G0(t,"state",W0(null),vve),et(t,"stateLength",null),et(t,"byteLength",null),et(t,"toJSON",W0(null)),et(t,"PRNG",i)):(kg(t,"seed",n),kg(t,"seedLength",a),G0(t,"state",g,d),kg(t,"stateLength",u),kg(t,"byteLength",o),et(t,"toJSON",m),et(t,"PRNG",i),i=i.normalized),t;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function d(y){i.state=y}function m(){var y={};return y.type="PRNG",y.name=t.NAME,y.state=dve(i.state),r===void 0?y.params=[]:y.params=[r],y}function c(){return I0(i,r)}function p(y){return fve(y)||y<=0?NaN:I0(i,y)}}z0.exports=lve});var J0=s(function(Z7e,k0){"use strict";var cve=Yc(),mve=cve();k0.exports=mve});var pa=s(function(Q7e,C0){"use strict";var hve=require("@stdlib/utils/define-nonenumerable-read-only-property"),U0=J0(),pve=Yc();hve(U0,"factory",pve);C0.exports=U0});var X0=s(function($7e,B0){"use strict";var yve=require("@stdlib/assert/is-positive-number").isPrimitive,qve=require("@stdlib/assert/is-number").isPrimitive,Hc=require("@stdlib/string/format"),bve=require("@stdlib/assert/is-nan");function wve(r,e){return yve(r)?!qve(e)||bve(e)?new TypeError(Hc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):e<=0||e>=1?new RangeError(Hc("invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.",e)):null:new TypeError(Hc("invalid argument. First argument must be a positive number. Value: `%s`.",r))}B0.exports=wve});var Kc=s(function(K7e,ej){"use strict";var Et=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),D0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ya=require("@stdlib/assert/has-own-property"),Y0=require("@stdlib/assert/is-plain-object"),Zc=require("@stdlib/assert/is-uint32array"),H0=require("@stdlib/assert/is-boolean").isPrimitive,Z0=require("@stdlib/assert/is-function"),Q0=require("@stdlib/utils/constant-function"),Sve=require("@stdlib/utils/noop"),$0=require("@stdlib/math/base/assert/is-nan"),qa=pa().factory,Bg=ze().factory,Qc=require("@stdlib/blas/base/gcopy"),$c=require("@stdlib/array/uint32"),K0=require("@stdlib/object/assign"),Ove=require("@stdlib/array/to-json"),rt=require("@stdlib/string/format"),Nve=X0();function Lve(){var r,e,i,t,n,a,u,o,g,d;if(u=!0,arguments.length===0)t={copy:!1},i=qa(t);else if(arguments.length===1){if(t=arguments[0],!Y0(t))throw new TypeError(rt("invalid argument. Options argument must be an object. Value: `%s`.",t));if(ya(t,"copy")&&!H0(t.copy))throw new TypeError(rt("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",t.copy));if(ya(t,"prng")){if(!Z0(t.prng))throw new TypeError(rt("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=qa({prng:t.prng})}else{if(ya(t,"state")&&!Zc(t.state))throw new TypeError(rt("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",t.state));t=K0({},t),t.copy===!1?u=!1:t.state&&(t.state=Qc(t.state.length,t.state,1,new $c(t.state.length),1)),t.copy=!1,i=qa(t)}}else{if(d=arguments[0],g=arguments[1],o=Nve(d,g),o)throw o;if(arguments.length>2){if(t=arguments[2],!Y0(t))throw new TypeError(rt("invalid argument. Options argument must be an object. Value: `%s`.",t));if(ya(t,"copy")&&!H0(t.copy))throw new TypeError(rt("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",t.copy));if(ya(t,"prng")){if(!Z0(t.prng))throw new TypeError(rt("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=qa({prng:t.prng})}else{if(ya(t,"state")&&!Zc(t.state))throw new TypeError(rt("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",t.state));t=K0({},t),t.copy===!1?u=!1:t.state&&(t.state=Qc(t.state.length,t.state,1,new $c(t.state.length),1)),t.copy=!1,i=qa(t)}}else t={copy:!1},i=qa(t)}return t&&t.prng?d===void 0?r=Bg({prng:t.prng}):r=Bg(d,g/(1-g),{prng:t.prng}):(t.state?e=t.state:(e=i.state,i.state=e),d===void 0?r=Bg({state:e,copy:!1}):r=Bg(d,g/(1-g),{state:e,copy:!1})),d===void 0?n=q:n=h,a=i.PRNG,Et(n,"NAME","negative-binomial"),t&&t.prng?(Et(n,"seed",null),Et(n,"seedLength",null),D0(n,"state",Q0(null),Sve),Et(n,"stateLength",null),Et(n,"byteLength",null),Et(n,"toJSON",Q0(null))):(Cg(n,"seed",m),Cg(n,"seedLength",c),D0(n,"state",f,l),Cg(n,"stateLength",p),Cg(n,"byteLength",y),Et(n,"toJSON",v)),Et(n,"PRNG",a),n;function m(){return a.seed}function c(){return a.seedLength}function p(){return a.stateLength}function y(){return a.byteLength}function f(){return a.state}function l(b){if(!Zc(b))throw new TypeError(rt("invalid argument. Must provide a Uint32Array. Value: `%s`.",b));u&&(b=Qc(b.length,b,1,new $c(b.length),1)),a.state=b}function v(){var b={};return b.type="PRNG",b.name=n.NAME,b.state=Ove(a.state),d===void 0?b.params=[]:b.params=[d,g],b}function h(){return i(r())}function q(b,w){return $0(b)||$0(w)||w<=0||w>=1?NaN:i(r(b,w/(1-w)))}}ej.exports=Lve});var tj=s(function(e6e,rj){"use strict";var Eve=Kc(),Rve=Eve();rj.exports=Rve});var tu=s(function(r6e,nj){"use strict";var Pve=require("@stdlib/utils/define-nonenumerable-read-only-property"),ij=tj(),_ve=Kc();Pve(ij,"factory",_ve);nj.exports=ij});var oj=s(function(t6e,uj){"use strict";var aj=require("@stdlib/assert/is-positive-number").isPrimitive,sj=require("@stdlib/string/format");function Tve(r,e){return aj(r)?aj(e)?null:new TypeError(sj("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(sj("invalid argument. First argument must be a positive number. Value: `%s`.",r))}uj.exports=Tve});var vj=s(function(i6e,gj){"use strict";var jve=require("@stdlib/math/base/special/pow");function Mve(r,e,i){return i/jve(r(),1/e)}gj.exports=Mve});var em=s(function(n6e,yj){"use strict";var tt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dj=require("@stdlib/assert/is-plain-object"),lj=require("@stdlib/assert/is-function"),cj=require("@stdlib/assert/has-own-property"),mj=require("@stdlib/utils/constant-function"),xve=require("@stdlib/utils/noop"),Dg=j().factory,hj=require("@stdlib/math/base/assert/is-nan"),Gve=require("@stdlib/array/to-json"),Yg=require("@stdlib/string/format"),Ave=oj(),pj=vj();function Vve(){var r,e,i,t,n,a;if(arguments.length===0)t=Dg();else if(arguments.length===1){if(i=arguments[0],!dj(i))throw new TypeError(Yg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(cj(i,"prng")){if(!lj(i.prng))throw new TypeError(Yg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=i.prng}else t=Dg(i)}else{if(r=arguments[0],e=arguments[1],a=Ave(r,e),a)throw a;if(arguments.length>2){if(i=arguments[2],!dj(i))throw new TypeError(Yg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(cj(i,"prng")){if(!lj(i.prng))throw new TypeError(Yg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=i.prng}else t=Dg(i)}else t=Dg()}return r===void 0?n=f:n=y,tt(n,"NAME","pareto-type1"),i&&i.prng?(tt(n,"seed",null),tt(n,"seedLength",null),fj(n,"state",mj(null),xve),tt(n,"stateLength",null),tt(n,"byteLength",null),tt(n,"toJSON",mj(null)),tt(n,"PRNG",t)):(Xg(n,"seed",u),Xg(n,"seedLength",o),fj(n,"state",m,c),Xg(n,"stateLength",g),Xg(n,"byteLength",d),tt(n,"toJSON",p),tt(n,"PRNG",t),t=t.normalized),n;function u(){return t.seed}function o(){return t.seedLength}function g(){return t.stateLength}function d(){return t.byteLength}function m(){return t.state}function c(l){t.state=l}function p(){var l={};return l.type="PRNG",l.name=n.NAME,l.state=Gve(t.state),r===void 0?l.params=[]:l.params=[r,e],l}function y(){return pj(t,r,e)}function f(l,v){return hj(l)||hj(v)||l<=0||v<=0?NaN:pj(t,l,v)}}yj.exports=Vve});var bj=s(function(a6e,qj){"use strict";var Fve=em(),Wve=Fve();qj.exports=Wve});var iu=s(function(s6e,Sj){"use strict";var Ive=require("@stdlib/utils/define-nonenumerable-read-only-property"),wj=bj(),zve=em();Ive(wj,"factory",zve);Sj.exports=wj});var Oj=s(function(u6e,kve){kve.exports={name:"mt19937",copy:!0}});var Lj=s(function(o6e,Nj){"use strict";var Jve=H(),Uve=Q(),Cve=j(),Hg={};Hg.minstd=Jve;Hg["minstd-shuffle"]=Uve;Hg.mt19937=Cve;Nj.exports=Hg});var rm=s(function(g6e,Rj){"use strict";var nu=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Bve=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Xve=require("@stdlib/assert/is-plain-object"),Dve=require("@stdlib/assert/is-boolean").isPrimitive,Qg=require("@stdlib/assert/has-own-property"),Yve=require("@stdlib/array/to-json"),au=require("@stdlib/string/format"),Ej=Oj(),Hve=Lj();function Zve(r){var e,i,t;if(e={name:Ej.name,copy:Ej.copy},arguments.length){if(!Xve(r))throw new TypeError(au("invalid argument. Must provide an object. Value: `%s`.",r));if(Qg(r,"name")&&(e.name=r.name),Qg(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(au("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(Qg(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(au("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(Qg(r,"copy")&&(e.copy=r.copy,!Dve(e.copy)))throw new TypeError(au("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(t=Hve[e.name],t===void 0)throw new Error(au("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.state===void 0?e.seed===void 0?i=t.factory():i=t.factory({seed:e.seed}):i=t.factory({state:e.state,copy:e.copy}),nu(c,"NAME","randi"),Zg(c,"seed",n),Zg(c,"seedLength",a),Bve(c,"state",g,d),Zg(c,"stateLength",u),Zg(c,"byteLength",o),nu(c,"toJSON",m),nu(c,"PRNG",i),nu(c,"MIN",i.MIN),nu(c,"MAX",i.MAX),c;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function d(p){i.state=p}function m(){var p={};return p.type="PRNG",p.name=c.NAME+"-"+i.NAME,p.state=Yve(i.state),p.params=[],p}function c(){return i()}}Rj.exports=Zve});var _j=s(function(v6e,Pj){"use strict";var Qve=rm(),$ve=Qve();Pj.exports=$ve});var su=s(function(f6e,jj){"use strict";var Kve=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tj=_j(),efe=rm();Kve(Tj,"factory",efe);jj.exports=Tj});var Mj=s(function(d6e,rfe){rfe.exports={name:"improved-ziggurat",copy:!0}});var Gj=s(function(l6e,xj){"use strict";var tfe=da(),ife=Y(),tm={};tm["box-muller"]=tfe;tm["improved-ziggurat"]=ife;xj.exports=tm});var im=s(function(c6e,Wj){"use strict";var Rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),$g=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Aj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nfe=require("@stdlib/assert/is-plain-object"),afe=require("@stdlib/assert/is-boolean").isPrimitive,uu=require("@stdlib/assert/has-own-property"),Vj=require("@stdlib/utils/constant-function"),ba=require("@stdlib/string/format"),sfe=require("@stdlib/utils/noop"),ufe=require("@stdlib/array/to-json"),Fj=Mj(),ofe=Gj();function gfe(r){var e,i,t;if(e={name:Fj.name,copy:Fj.copy},arguments.length){if(!nfe(r))throw new TypeError(ba("invalid argument. Must provide an object. Value: `%s`.",r));if(uu(r,"name")&&(e.name=r.name),uu(r,"prng")){if(e.prng=r.prng,e.prng===void 0)throw new TypeError(ba("invalid option. `%s` option cannot be undefined. Option: `%s`.","prng",e.prng))}else if(uu(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(ba("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(uu(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(ba("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(uu(r,"copy")&&(e.copy=r.copy,!afe(e.copy)))throw new TypeError(ba("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(t=ofe[e.name],t===void 0)throw new Error(ba("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.prng===void 0?e.state===void 0?e.seed===void 0?i=t.factory():i=t.factory({seed:e.seed}):i=t.factory({state:e.state,copy:e.copy}):i=t.factory({prng:e.prng}),Rt(c,"NAME","randn"),e.prng?(Rt(c,"seed",null),Rt(c,"seedLength",null),Aj(c,"state",Vj(null),sfe),Rt(c,"stateLength",null),Rt(c,"byteLength",null),Rt(c,"toJSON",Vj(null))):($g(c,"seed",n),$g(c,"seedLength",a),Aj(c,"state",g,d),$g(c,"stateLength",u),$g(c,"byteLength",o),Rt(c,"toJSON",m)),Rt(c,"PRNG",i.PRNG),c;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function d(p){i.state=p}function m(){var p={};return p.type="PRNG",p.name=c.NAME+"-"+i.NAME,p.state=ufe(i.state),p.params=[],p}function c(){return i()}}Wj.exports=gfe});var zj=s(function(m6e,Ij){"use strict";var vfe=im(),ffe=vfe();Ij.exports=ffe});var ou=s(function(h6e,Jj){"use strict";var dfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),kj=zj(),lfe=im();dfe(kj,"factory",lfe);Jj.exports=kj});var Cj=s(function(p6e,Uj){"use strict";var cfe=require("@stdlib/math/base/special/sqrt"),mfe=require("@stdlib/math/base/special/ln");function hfe(r,e){return e*cfe(-2*mfe(r()))}Uj.exports=hfe});var nm=s(function(y6e,Qj){"use strict";var it=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Bj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),pfe=require("@stdlib/assert/is-positive-number").isPrimitive,Xj=require("@stdlib/assert/is-plain-object"),Dj=require("@stdlib/assert/is-function"),Yj=require("@stdlib/assert/has-own-property"),Hj=require("@stdlib/utils/constant-function"),yfe=require("@stdlib/utils/noop"),ev=j().factory,qfe=require("@stdlib/math/base/assert/is-nan"),bfe=require("@stdlib/array/to-json"),rv=require("@stdlib/string/format"),Zj=Cj();function wfe(){var r,e,i,t;if(arguments.length===0)i=ev();else if(arguments.length===1&&Xj(arguments[0]))if(e=arguments[0],Yj(e,"prng")){if(!Dj(e.prng))throw new TypeError(rv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=ev(e);else{if(r=arguments[0],!pfe(r))throw new TypeError(rv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!Xj(e))throw new TypeError(rv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(Yj(e,"prng")){if(!Dj(e.prng))throw new TypeError(rv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=ev(e)}else i=ev()}return r===void 0?t=p:t=c,it(t,"NAME","rayleigh"),e&&e.prng?(it(t,"seed",null),it(t,"seedLength",null),Bj(t,"state",Hj(null),yfe),it(t,"stateLength",null),it(t,"byteLength",null),it(t,"toJSON",Hj(null)),it(t,"PRNG",i)):(Kg(t,"seed",n),Kg(t,"seedLength",a),Bj(t,"state",g,d),Kg(t,"stateLength",u),Kg(t,"byteLength",o),it(t,"toJSON",m),it(t,"PRNG",i),i=i.normalized),t;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function d(y){i.state=y}function m(){var y={};return y.type="PRNG",y.name=t.NAME,y.state=bfe(i.state),r===void 0?y.params=[]:y.params=[r],y}function c(){return Zj(i,r)}function p(y){return qfe(y)||y<=0?NaN:Zj(i,y)}}Qj.exports=wfe});var Kj=s(function(q6e,$j){"use strict";var Sfe=nm(),Ofe=Sfe();$j.exports=Ofe});var gu=s(function(b6e,rM){"use strict";var Nfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),eM=Kj(),Lfe=nm();Nfe(eM,"factory",Lfe);rM.exports=eM});var om=s(function(w6e,vM){"use strict";var Pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),tv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),tM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wa=require("@stdlib/assert/has-own-property"),iM=require("@stdlib/assert/is-positive-number").isPrimitive,nM=require("@stdlib/assert/is-plain-object"),am=require("@stdlib/assert/is-uint32array"),aM=require("@stdlib/assert/is-boolean").isPrimitive,Efe=require("@stdlib/math/base/assert/is-nan"),sM=require("@stdlib/assert/is-function"),uM=require("@stdlib/utils/constant-function"),Rfe=require("@stdlib/utils/noop"),iv=St().factory,Sa=Y().factory,sm=require("@stdlib/blas/base/gcopy"),um=require("@stdlib/array/uint32"),oM=require("@stdlib/object/assign"),Pfe=require("@stdlib/array/to-json"),Ce=require("@stdlib/string/format"),gM=require("@stdlib/math/base/special/sqrt");function _fe(){var r,e,i,t,n,a,u,o;if(u=!0,arguments.length===0)n={copy:!1},i=Sa(n);else if(arguments.length===1)if(nM(arguments[0])){if(n=arguments[0],wa(n,"copy")&&!aM(n.copy))throw new TypeError(Ce("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(wa(n,"prng")){if(!sM(n.prng))throw new TypeError(Ce("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));i=Sa({prng:n.prng})}else{if(wa(n,"state")&&!am(n.state))throw new TypeError(Ce("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=oM({},n),n.copy===!1?u=!1:n.state&&(n.state=sm(n.state.length,n.state,1,new um(n.state.length),1)),n.copy=!1,i=Sa(n)}}else{if(o=arguments[0],!iM(o))throw new TypeError(Ce("invalid argument. First argument must be a positive number or an options object. Value: `%s`.",o));n={copy:!1},i=Sa(n)}else{if(o=arguments[0],!iM(o))throw new TypeError(Ce("invalid argument. First argument must be a positive number. Value: `%s`.",o));if(n=arguments[1],!nM(n))throw new TypeError(Ce("invalid argument. Options argument must be an object. Value: `%s`.",n));if(wa(n,"copy")&&!aM(n.copy))throw new TypeError(Ce("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(wa(n,"prng")){if(!sM(n.prng))throw new TypeError(Ce("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));i=Sa({prng:n.prng})}else{if(wa(n,"state")&&!am(n.state))throw new TypeError(Ce("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=oM({},n),n.copy===!1?u=!1:n.state&&(n.state=sm(n.state.length,n.state,1,new um(n.state.length),1)),n.copy=!1,i=Sa(n)}}return n&&n.prng?o===void 0?r=iv({prng:n.prng}):r=iv(o,{prng:n.prng}):(n.state?e=n.state:(e=i.state,i.state=e),o===void 0?r=iv({state:e,copy:!1}):r=iv(o,{state:e,copy:!1})),o===void 0?a=v:a=l,t=i.PRNG,Pt(a,"NAME","t"),n&&n.prng?(Pt(a,"seed",null),Pt(a,"seedLength",null),tM(a,"state",uM(null),Rfe),Pt(a,"stateLength",null),Pt(a,"byteLength",null),Pt(a,"toJSON",uM(null))):(tv(a,"seed",g),tv(a,"seedLength",d),tM(a,"state",p,y),tv(a,"stateLength",m),tv(a,"byteLength",c),Pt(a,"toJSON",f)),Pt(a,"PRNG",t),a;function g(){return t.seed}function d(){return t.seedLength}function m(){return t.stateLength}function c(){return t.byteLength}function p(){return t.state}function y(h){if(!am(h))throw new TypeError(Ce("invalid argument. Must provide a Uint32Array. Value: `%s`.",h));u&&(h=sm(h.length,h,1,new um(h.length),1)),t.state=h}function f(){var h={};return h.type="PRNG",h.name=a.NAME,h.state=Pfe(t.state),o===void 0?h.params=[]:h.params=[o],h}function l(){return i()/gM(r()/o)}function v(h){return Efe(h)||h<=0?NaN:i()/gM(r(h)/h)}}vM.exports=_fe});var dM=s(function(S6e,fM){"use strict";var Tfe=om(),jfe=Tfe();fM.exports=jfe});var vu=s(function(O6e,cM){"use strict";var Mfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),lM=dM(),xfe=om();Mfe(lM,"factory",xfe);cM.exports=lM});var hM=s(function(N6e,mM){"use strict";var gm=require("@stdlib/assert/is-number").isPrimitive,nv=require("@stdlib/string/format"),vm=require("@stdlib/assert/is-nan");function Gfe(r,e,i){return!gm(r)||vm(r)?new TypeError(nv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!gm(e)||vm(e)?new TypeError(nv("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):!gm(i)||vm(i)?new TypeError(nv("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",i)):r<=i&&i<=e?null:new RangeError(nv("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,i))}mM.exports=Gfe});var qM=s(function(L6e,yM){"use strict";var pM=require("@stdlib/math/base/special/sqrt");function Afe(r,e,i,t){var n,a,u;return n=(t-e)/(i-e),u=r(),u3){if(r=arguments[3],!wM(r))throw new TypeError(uv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(OM(r,"prng")){if(!SM(r.prng))throw new TypeError(uv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=sv(r)}else e=sv()}return n===void 0?i=l:i=f,nt(i,"NAME","triangular"),r&&r.prng?(nt(i,"seed",null),nt(i,"seedLength",null),bM(i,"state",NM(null),Vfe),nt(i,"stateLength",null),nt(i,"byteLength",null),nt(i,"toJSON",NM(null)),nt(i,"PRNG",e)):(av(i,"seed",o),av(i,"seedLength",g),bM(i,"state",c,p),av(i,"stateLength",d),av(i,"byteLength",m),nt(i,"toJSON",y),nt(i,"PRNG",e),e=e.normalized),i;function o(){return e.seed}function g(){return e.seedLength}function d(){return e.stateLength}function m(){return e.byteLength}function c(){return e.state}function p(v){e.state=v}function y(){var v={};return v.type="PRNG",v.name=i.NAME,v.state=Ffe(e.state),n===void 0?v.params=[]:v.params=[n,a,u],v}function f(){return LM(e,n,a,u)}function l(v,h,q){return fm(v)||fm(h)||fm(q)||!(v<=q&&q<=h)?NaN:LM(e,v,h,q)}}EM.exports=Ife});var PM=s(function(R6e,RM){"use strict";var zfe=dm(),kfe=zfe();RM.exports=kfe});var fu=s(function(P6e,TM){"use strict";var Jfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),_M=PM(),Ufe=dm();Jfe(_M,"factory",Ufe);TM.exports=_M});var GM=s(function(_6e,xM){"use strict";var jM=require("@stdlib/assert/is-positive-number").isPrimitive,MM=require("@stdlib/string/format");function Cfe(r,e){return jM(r)?jM(e)?null:new TypeError(MM("invalid argument. Shape parameter must be a positive number. Value: `%s`.",e)):new TypeError(MM("invalid argument. Scale parameter must be a positive number. Value: `%s`.",r))}xM.exports=Cfe});var VM=s(function(T6e,AM){"use strict";var Bfe=require("@stdlib/math/base/special/pow"),Xfe=require("@stdlib/math/base/special/ln");function Dfe(r,e,i){return i*Bfe(-Xfe(1-r()),1/e)}AM.exports=Dfe});var lm=s(function(j6e,CM){"use strict";var at=require("@stdlib/utils/define-nonenumerable-read-only-property"),ov=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),FM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),WM=require("@stdlib/assert/is-plain-object"),IM=require("@stdlib/assert/is-function"),zM=require("@stdlib/assert/has-own-property"),kM=require("@stdlib/utils/constant-function"),Yfe=require("@stdlib/utils/noop"),gv=j().factory,JM=require("@stdlib/math/base/assert/is-nan"),Hfe=require("@stdlib/array/to-json"),vv=require("@stdlib/string/format"),Zfe=GM(),UM=VM();function Qfe(){var r,e,i,t,n,a;if(arguments.length===0)i=gv();else if(arguments.length===1){if(e=arguments[0],!WM(e))throw new TypeError(vv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(zM(e,"prng")){if(!IM(e.prng))throw new TypeError(vv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=gv(e)}else{if(a=arguments[0],r=arguments[1],n=Zfe(r,a),n)throw n;if(arguments.length>2){if(e=arguments[2],!WM(e))throw new TypeError(vv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(zM(e,"prng")){if(!IM(e.prng))throw new TypeError(vv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=gv(e)}else i=gv()}return r===void 0?t=f:t=y,at(t,"NAME","weibull"),e&&e.prng?(at(t,"seed",null),at(t,"seedLength",null),FM(t,"state",kM(null),Yfe),at(t,"stateLength",null),at(t,"byteLength",null),at(t,"toJSON",kM(null)),at(t,"PRNG",i)):(ov(t,"seed",u),ov(t,"seedLength",o),FM(t,"state",m,c),ov(t,"stateLength",g),ov(t,"byteLength",d),at(t,"toJSON",p),at(t,"PRNG",i),i=i.normalized),t;function u(){return i.seed}function o(){return i.seedLength}function g(){return i.stateLength}function d(){return i.byteLength}function m(){return i.state}function c(l){i.state=l}function p(){var l={};return l.type="PRNG",l.name=t.NAME,l.state=Hfe(i.state),a===void 0?l.params=[]:l.params=[a,r],l}function y(){return UM(i,a,r)}function f(l,v){return JM(l)||JM(v)||l<=0||v<=0?NaN:UM(i,l,v)}}CM.exports=Qfe});var XM=s(function(M6e,BM){"use strict";var $fe=lm(),Kfe=$fe();BM.exports=Kfe});var Oa=s(function(x6e,YM){"use strict";var ede=require("@stdlib/utils/define-nonenumerable-read-only-property"),DM=XM(),rde=lm();ede(DM,"factory",rde);YM.exports=DM});var ZM=s(function(G6e,HM){"use strict";var tde=Ki(),ide=zs(),nde=rn(),ade=tn(),sde=ks(),ude=da(),ode=Cs(),gde=Bs(),vde=St(),fde=nn(),dde=an(),lde=Xs(),cde=sn(),mde=Ds(),hde=Ys(),pde=ze(),yde=aa(),qde=Hs(),bde=Qs(),wde=Y(),Sde=un(),Ode=$s(),Nde=Ks(),Lde=eu(),Ede=ru(),Rde=on(),Pde=H(),_de=Q(),Tde=j(),jde=tu(),Mde=gn(),xde=iu(),Gde=pa(),Ade=su(),Vde=ou(),Fde=qt(),Wde=gu(),Ide=vu(),zde=fu(),kde=vn(),Jde=Oa(),L={};L.arcsine=tde.factory;L.bernoulli=ide.factory;L.beta=nde.factory;L.betaprime=ade.factory;L.binomial=sde.factory;L["box-muller"]=ude.factory;L.cauchy=ode.factory;L.chi=gde.factory;L.chisquare=vde.factory;L.cosine=fde.factory;L["discrete-uniform"]=dde.factory;L.erlang=lde.factory;L.exponential=cde.factory;L.f=mde.factory;L.frechet=hde.factory;L.gamma=pde.factory;L.geometric=yde.factory;L.gumbel=qde.factory;L.hypergeometric=bde.factory;L["improved-ziggurat"]=wde.factory;L.invgamma=Sde.factory;L.kumaraswamy=Ode.factory;L.laplace=Nde.factory;L.levy=Lde.factory;L.logistic=Ede.factory;L.lognormal=Rde.factory;L.minstd=Pde.factory;L["minstd-shuffle"]=_de.factory;L.mt19937=Tde.factory;L["negative-binomial"]=jde.factory;L.normal=Mde.factory;L["pareto-type1"]=xde.factory;L.poisson=Gde.factory;L.randi=Ade.factory;L.randn=Vde.factory;L.randu=Fde.factory;L.rayleigh=Wde.factory;L.t=Ide.factory;L.triangular=zde.factory;L.uniform=kde.factory;L.weibull=Jde.factory;HM.exports=L});var r1=s(function(A6e,e1){"use strict";var QM=require("@stdlib/assert/is-string").isPrimitive,Ude=require("@stdlib/assert/is-plain-object"),$M=require("@stdlib/assert/is-array"),Cde=require("@stdlib/assert/contains"),Bde=require("@stdlib/array/int32"),Xde=require("@stdlib/array/uint32"),KM=ZM(),Dde={Int32Array:Bde,Uint32Array:Xde},Yde=["randi","randn","randu"];function Hde(r,e){var i,t,n,a,u;if(e&&e.type==="PRNG"&&QM(e.name)&&Ude(e.state)&&$M(e.params)&&QM(e.state.type)&&$M(e.state.data)&&(t={},i=KM[e.name],i===void 0&&(u=e.name.split("-"),Cde(Yde,u[0])&&(i=KM[u[0]],t.name=u.slice(1).join("-"))),i&&(a=Dde[e.state.type],a))){t.state=new a(e.state.data),n=e.params.slice(),n.push(t);try{return i.apply(null,n)}catch(o){}}return e}e1.exports=Hde});var i1=s(function(V6e,t1){"use strict";var Zde=r1();t1.exports=Zde});var a1=s(function(F6e,n1){"use strict";var E=require("@stdlib/utils/define-read-only-property"),N={};E(N,"arcsine",Ki());E(N,"bernoulli",zs());E(N,"beta",rn());E(N,"betaprime",tn());E(N,"binomial",ks());E(N,"boxMuller",da());E(N,"cauchy",Cs());E(N,"chi",Bs());E(N,"chisquare",St());E(N,"cosine",nn());E(N,"discreteUniform",an());E(N,"erlang",Xs());E(N,"exponential",sn());E(N,"f",Ds());E(N,"frechet",Ys());E(N,"gamma",ze());E(N,"geometric",aa());E(N,"gumbel",Hs());E(N,"hypergeometric",Qs());E(N,"improvedZiggurat",Y());E(N,"invgamma",un());E(N,"kumaraswamy",$s());E(N,"laplace",Ks());E(N,"levy",eu());E(N,"logistic",ru());E(N,"lognormal",on());E(N,"minstd",H());E(N,"minstdShuffle",Q());E(N,"mt19937",j());E(N,"negativeBinomial",tu());E(N,"normal",gn());E(N,"pareto1",iu());E(N,"poisson",pa());E(N,"randi",su());E(N,"randn",ou());E(N,"randu",qt());E(N,"rayleigh",gu());E(N,"reviveBasePRNG",i1());E(N,"t",vu());E(N,"triangular",fu());E(N,"uniform",vn());E(N,"weibull",Oa());n1.exports=N});var c1=s(function(W6e,l1){"use strict";var _t=require("@stdlib/utils/define-nonenumerable-read-only-property"),fv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),s1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Qde=require("@stdlib/utils/constant-function"),$de=require("@stdlib/utils/noop"),Kde=require("@stdlib/object/assign"),u1=require("@stdlib/assert/is-number").isPrimitive,o1=require("@stdlib/math/base/assert/is-nan"),ele=require("@stdlib/assert/is-plain-object"),rle=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,tle=require("@stdlib/assert/has-own-property"),g1=require("@stdlib/constants/float64/max"),v1=Ki().factory,f1=require("@stdlib/symbol/iterator"),du=require("@stdlib/string/format");function d1(r,e,i){var t,n,a,u,o;if(!u1(r)||o1(r))throw new TypeError(du("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!u1(e)||o1(e))throw new TypeError(du("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(du("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(arguments.length>2){if(!ele(i))throw new TypeError(du("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Kde({},i),tle(t,"iter")){if(!rle(t.iter))throw new TypeError(du("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=g1;a=v1(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=v1(r,e),t={iter:g1,state:a.state};return o=0,n={},_t(n,"next",g),_t(n,"return",d),t&&t.prng?(_t(n,"seed",null),_t(n,"seedLength",null),s1(n,"state",Qde(null),$de),_t(n,"stateLength",null),_t(n,"byteLength",null)):(fv(n,"seed",c),fv(n,"seedLength",p),s1(n,"state",l,v),fv(n,"stateLength",y),fv(n,"byteLength",f)),_t(n,"PRNG",a.PRNG),f1&&_t(n,f1,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return d1(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}l1.exports=d1});var h1=s(function(I6e,m1){"use strict";var ile=c1();m1.exports=ile});var O1=s(function(z6e,S1){"use strict";var Tt=require("@stdlib/utils/define-nonenumerable-read-only-property"),dv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),p1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nle=require("@stdlib/utils/constant-function"),ale=require("@stdlib/utils/noop"),sle=require("@stdlib/object/assign"),ule=require("@stdlib/assert/is-probability").isPrimitive,ole=require("@stdlib/assert/is-plain-object"),gle=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,vle=require("@stdlib/assert/has-own-property"),y1=require("@stdlib/constants/float64/max"),q1=zs().factory,b1=require("@stdlib/symbol/iterator"),cm=require("@stdlib/string/format");function w1(r,e){var i,t,n,a,u;if(!ule(r))throw new TypeError(cm("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!ole(e))throw new TypeError(cm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=sle({},e),vle(i,"iter")){if(!gle(i.iter))throw new TypeError(cm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=y1;n=q1(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=q1(r),i={iter:y1,state:n.state};return u=0,t={},Tt(t,"next",o),Tt(t,"return",g),i&&i.prng?(Tt(t,"seed",null),Tt(t,"seedLength",null),p1(t,"state",nle(null),ale),Tt(t,"stateLength",null),Tt(t,"byteLength",null)):(dv(t,"seed",m),dv(t,"seedLength",c),p1(t,"state",f,l),dv(t,"stateLength",p),dv(t,"byteLength",y)),Tt(t,"PRNG",n.PRNG),b1&&Tt(t,b1,d),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function d(){return w1(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function p(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function f(){return n.PRNG.state}function l(v){n.PRNG.state=v}}S1.exports=w1});var L1=s(function(k6e,N1){"use strict";var fle=O1();N1.exports=fle});var x1=s(function(J6e,M1){"use strict";var jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),lv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),E1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dle=require("@stdlib/utils/constant-function"),lle=require("@stdlib/utils/noop"),cle=require("@stdlib/object/assign"),R1=require("@stdlib/assert/is-positive-number").isPrimitive,mle=require("@stdlib/assert/is-plain-object"),hle=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ple=require("@stdlib/assert/has-own-property"),P1=require("@stdlib/constants/float64/max"),_1=rn().factory,T1=require("@stdlib/symbol/iterator"),cv=require("@stdlib/string/format");function j1(r,e,i){var t,n,a,u,o;if(!R1(r))throw new TypeError(cv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!R1(e))throw new TypeError(cv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!mle(i))throw new TypeError(cv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=cle({},i),ple(t,"iter")){if(!hle(t.iter))throw new TypeError(cv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=P1;a=_1(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=_1(r,e),t={iter:P1,state:a.state};return o=0,n={},jt(n,"next",g),jt(n,"return",d),t&&t.prng?(jt(n,"seed",null),jt(n,"seedLength",null),E1(n,"state",dle(null),lle),jt(n,"stateLength",null),jt(n,"byteLength",null)):(lv(n,"seed",c),lv(n,"seedLength",p),E1(n,"state",l,v),lv(n,"stateLength",y),lv(n,"byteLength",f)),jt(n,"PRNG",a.PRNG),T1&&jt(n,T1,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return j1(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}M1.exports=j1});var A1=s(function(U6e,G1){"use strict";var yle=x1();G1.exports=yle});var U1=s(function(C6e,J1){"use strict";var Mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),mv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),V1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qle=require("@stdlib/utils/constant-function"),ble=require("@stdlib/utils/noop"),wle=require("@stdlib/object/assign"),F1=require("@stdlib/assert/is-positive-number").isPrimitive,Sle=require("@stdlib/assert/is-plain-object"),Ole=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nle=require("@stdlib/assert/has-own-property"),W1=require("@stdlib/constants/float64/max"),I1=tn().factory,z1=require("@stdlib/symbol/iterator"),hv=require("@stdlib/string/format");function k1(r,e,i){var t,n,a,u,o;if(!F1(r))throw new TypeError(hv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!F1(e))throw new TypeError(hv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Sle(i))throw new TypeError(hv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=wle({},i),Nle(t,"iter")){if(!Ole(t.iter))throw new TypeError(hv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=W1;a=I1(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=I1(r,e),t={iter:W1,state:a.state};return o=0,n={},Mt(n,"next",g),Mt(n,"return",d),t&&t.prng?(Mt(n,"seed",null),Mt(n,"seedLength",null),V1(n,"state",qle(null),ble),Mt(n,"stateLength",null),Mt(n,"byteLength",null)):(mv(n,"seed",c),mv(n,"seedLength",p),V1(n,"state",l,v),mv(n,"stateLength",y),mv(n,"byteLength",f)),Mt(n,"PRNG",a.PRNG),z1&&Mt(n,z1,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return k1(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}J1.exports=k1});var B1=s(function(B6e,C1){"use strict";var Lle=U1();C1.exports=Lle});var $1=s(function(X6e,Q1){"use strict";var xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),pv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),X1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ele=require("@stdlib/utils/constant-function"),Rle=require("@stdlib/utils/noop"),Ple=require("@stdlib/object/assign"),_le=require("@stdlib/assert/is-probability").isPrimitive,Tle=require("@stdlib/assert/is-plain-object"),jle=require("@stdlib/assert/is-positive-integer").isPrimitive,Mle=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xle=require("@stdlib/assert/has-own-property"),D1=require("@stdlib/constants/float64/max"),Y1=ks().factory,H1=require("@stdlib/symbol/iterator"),yv=require("@stdlib/string/format");function Z1(r,e,i){var t,n,a,u,o;if(!jle(r))throw new TypeError(yv("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!_le(e))throw new TypeError(yv("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!Tle(i))throw new TypeError(yv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Ple({},i),xle(t,"iter")){if(!Mle(t.iter))throw new TypeError(yv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=D1;a=Y1(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=Y1(r,e),t={iter:D1,state:a.state};return o=0,n={},xt(n,"next",g),xt(n,"return",d),t&&t.prng?(xt(n,"seed",null),xt(n,"seedLength",null),X1(n,"state",Ele(null),Rle),xt(n,"stateLength",null),xt(n,"byteLength",null)):(pv(n,"seed",c),pv(n,"seedLength",p),X1(n,"state",l,v),pv(n,"stateLength",y),pv(n,"byteLength",f)),xt(n,"PRNG",a.PRNG),H1&&xt(n,H1,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return Z1(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}Q1.exports=Z1});var ex=s(function(D6e,K1){"use strict";var Gle=$1();K1.exports=Gle});var ox=s(function(Y6e,ux){"use strict";var Gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),qv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),rx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ale=require("@stdlib/utils/constant-function"),Vle=require("@stdlib/utils/noop"),Fle=require("@stdlib/object/assign"),Wle=require("@stdlib/assert/is-plain-object"),Ile=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zle=require("@stdlib/assert/has-own-property"),tx=require("@stdlib/constants/float64/max"),ix=da().factory,nx=require("@stdlib/symbol/iterator"),ax=require("@stdlib/string/format");function sx(r){var e,i,t,n,a;if(arguments.length>0){if(!Wle(r))throw new TypeError(ax("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Fle({},r),zle(e,"iter")){if(!Ile(e.iter))throw new TypeError(ax("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=tx;t=ix(e),e.prng===void 0&&e.copy!==!1&&(e.state=t.state)}else t=ix(),e={iter:tx,state:t.state};return a=0,i={},Gt(i,"next",u),Gt(i,"return",o),e&&e.prng?(Gt(i,"seed",null),Gt(i,"seedLength",null),rx(i,"state",Ale(null),Vle),Gt(i,"stateLength",null),Gt(i,"byteLength",null)):(qv(i,"seed",d),qv(i,"seedLength",m),rx(i,"state",y,f),qv(i,"stateLength",c),qv(i,"byteLength",p)),Gt(i,"PRNG",t.PRNG),nx&&Gt(i,nx,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return sx(e)}function d(){return t.PRNG.seed}function m(){return t.PRNG.seedLength}function c(){return t.PRNG.stateLength}function p(){return t.PRNG.byteLength}function y(){return t.PRNG.state}function f(l){t.PRNG.state=l}}ux.exports=sx});var vx=s(function(H6e,gx){"use strict";var kle=ox();gx.exports=kle});var px=s(function(Z6e,hx){"use strict";var At=require("@stdlib/utils/define-nonenumerable-read-only-property"),bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Jle=require("@stdlib/utils/constant-function"),Ule=require("@stdlib/utils/noop"),Cle=require("@stdlib/object/assign"),Ble=require("@stdlib/assert/is-number").isPrimitive,Xle=require("@stdlib/math/base/assert/is-nan"),Dle=require("@stdlib/assert/is-plain-object"),Yle=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Hle=require("@stdlib/assert/is-positive-number").isPrimitive,Zle=require("@stdlib/assert/has-own-property"),dx=require("@stdlib/constants/float64/max"),lx=Cs().factory,cx=require("@stdlib/symbol/iterator"),wv=require("@stdlib/string/format");function mx(r,e,i){var t,n,a,u,o;if(!Ble(r)||Xle(r))throw new TypeError(wv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Hle(e))throw new TypeError(wv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Dle(i))throw new TypeError(wv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Cle({},i),Zle(t,"iter")){if(!Yle(t.iter))throw new TypeError(wv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=dx;a=lx(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=lx(r,e),t={iter:dx,state:a.state};return o=0,n={},At(n,"next",g),At(n,"return",d),t&&t.prng?(At(n,"seed",null),At(n,"seedLength",null),fx(n,"state",Jle(null),Ule),At(n,"stateLength",null),At(n,"byteLength",null)):(bv(n,"seed",c),bv(n,"seedLength",p),fx(n,"state",l,v),bv(n,"stateLength",y),bv(n,"byteLength",f)),At(n,"PRNG",a.PRNG),cx&&At(n,cx,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return mx(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}hx.exports=mx});var qx=s(function(Q6e,yx){"use strict";var Qle=px();yx.exports=Qle});var Ex=s(function($6e,Lx){"use strict";var Vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$le=require("@stdlib/utils/constant-function"),Kle=require("@stdlib/utils/noop"),ece=require("@stdlib/object/assign"),rce=require("@stdlib/assert/is-positive-number").isPrimitive,tce=require("@stdlib/assert/is-plain-object"),ice=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,nce=require("@stdlib/assert/has-own-property"),wx=require("@stdlib/constants/float64/max"),Sx=Bs().factory,Ox=require("@stdlib/symbol/iterator"),mm=require("@stdlib/string/format");function Nx(r,e){var i,t,n,a,u;if(!rce(r))throw new TypeError(mm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!tce(e))throw new TypeError(mm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=ece({},e),nce(i,"iter")){if(!ice(i.iter))throw new TypeError(mm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=wx;n=Sx(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=Sx(r),i={iter:wx,state:n.state};return u=0,t={},Vt(t,"next",o),Vt(t,"return",g),i&&i.prng?(Vt(t,"seed",null),Vt(t,"seedLength",null),bx(t,"state",$le(null),Kle),Vt(t,"stateLength",null),Vt(t,"byteLength",null)):(Sv(t,"seed",m),Sv(t,"seedLength",c),bx(t,"state",f,l),Sv(t,"stateLength",p),Sv(t,"byteLength",y)),Vt(t,"PRNG",n.PRNG),Ox&&Vt(t,Ox,d),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function d(){return Nx(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function p(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function f(){return n.PRNG.state}function l(v){n.PRNG.state=v}}Lx.exports=Nx});var Px=s(function(K6e,Rx){"use strict";var ace=Ex();Rx.exports=ace});var Ax=s(function(eDe,Gx){"use strict";var Ft=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ov=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_x=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),sce=require("@stdlib/utils/constant-function"),uce=require("@stdlib/utils/noop"),oce=require("@stdlib/object/assign"),gce=require("@stdlib/assert/is-positive-number").isPrimitive,vce=require("@stdlib/assert/is-plain-object"),fce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,dce=require("@stdlib/assert/has-own-property"),Tx=require("@stdlib/constants/float64/max"),jx=St().factory,Mx=require("@stdlib/symbol/iterator"),hm=require("@stdlib/string/format");function xx(r,e){var i,t,n,a,u;if(!gce(r))throw new TypeError(hm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!vce(e))throw new TypeError(hm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=oce({},e),dce(i,"iter")){if(!fce(i.iter))throw new TypeError(hm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=Tx;n=jx(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=jx(r),i={iter:Tx,state:n.state};return u=0,t={},Ft(t,"next",o),Ft(t,"return",g),i&&i.prng?(Ft(t,"seed",null),Ft(t,"seedLength",null),_x(t,"state",sce(null),uce),Ft(t,"stateLength",null),Ft(t,"byteLength",null)):(Ov(t,"seed",m),Ov(t,"seedLength",c),_x(t,"state",f,l),Ov(t,"stateLength",p),Ov(t,"byteLength",y)),Ft(t,"PRNG",n.PRNG),Mx&&Ft(t,Mx,d),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function d(){return xx(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function p(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function f(){return n.PRNG.state}function l(v){n.PRNG.state=v}}Gx.exports=xx});var Fx=s(function(rDe,Vx){"use strict";var lce=Ax();Vx.exports=lce});var Cx=s(function(tDe,Ux){"use strict";var Wt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Wx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cce=require("@stdlib/utils/constant-function"),mce=require("@stdlib/utils/noop"),hce=require("@stdlib/object/assign"),pce=require("@stdlib/assert/is-number").isPrimitive,yce=require("@stdlib/math/base/assert/is-nan"),qce=require("@stdlib/assert/is-plain-object"),bce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wce=require("@stdlib/assert/is-positive-number").isPrimitive,Sce=require("@stdlib/assert/has-own-property"),Ix=require("@stdlib/constants/float64/max"),zx=nn().factory,kx=require("@stdlib/symbol/iterator"),Lv=require("@stdlib/string/format");function Jx(r,e,i){var t,n,a,u,o;if(!pce(r)||yce(r))throw new TypeError(Lv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!wce(e))throw new TypeError(Lv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!qce(i))throw new TypeError(Lv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=hce({},i),Sce(t,"iter")){if(!bce(t.iter))throw new TypeError(Lv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=Ix;a=zx(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=zx(r,e),t={iter:Ix,state:a.state};return o=0,n={},Wt(n,"next",g),Wt(n,"return",d),t&&t.prng?(Wt(n,"seed",null),Wt(n,"seedLength",null),Wx(n,"state",cce(null),mce),Wt(n,"stateLength",null),Wt(n,"byteLength",null)):(Nv(n,"seed",c),Nv(n,"seedLength",p),Wx(n,"state",l,v),Nv(n,"stateLength",y),Nv(n,"byteLength",f)),Wt(n,"PRNG",a.PRNG),kx&&Wt(n,kx,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return Jx(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}Ux.exports=Jx});var Xx=s(function(iDe,Bx){"use strict";var Oce=Cx();Bx.exports=Oce});var eG=s(function(nDe,Kx){"use strict";var It=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ev=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Dx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Nce=require("@stdlib/utils/constant-function"),Lce=require("@stdlib/utils/noop"),Ece=require("@stdlib/object/assign"),Yx=require("@stdlib/assert/is-number").isPrimitive,Rce=require("@stdlib/assert/is-plain-object"),Pce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_ce=require("@stdlib/assert/has-own-property"),Hx=require("@stdlib/constants/float64/max"),Zx=an().factory,Qx=require("@stdlib/symbol/iterator"),lu=require("@stdlib/string/format");function $x(r,e,i){var t,n,a,u,o;if(!Yx(r))throw new TypeError(lu("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!Yx(e))throw new TypeError(lu("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(lu("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d,%d]`.",r,e));if(arguments.length>2){if(!Rce(i))throw new TypeError(lu("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Ece({},i),_ce(t,"iter")){if(!Pce(t.iter))throw new TypeError(lu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=Hx;a=Zx(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=Zx(r,e),t={iter:Hx,state:a.state};return o=0,n={},It(n,"next",g),It(n,"return",d),t&&t.prng?(It(n,"seed",null),It(n,"seedLength",null),Dx(n,"state",Nce(null),Lce),It(n,"stateLength",null),It(n,"byteLength",null)):(Ev(n,"seed",c),Ev(n,"seedLength",p),Dx(n,"state",l,v),Ev(n,"stateLength",y),Ev(n,"byteLength",f)),It(n,"PRNG",a.PRNG),Qx&&It(n,Qx,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return $x(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}Kx.exports=$x});var tG=s(function(aDe,rG){"use strict";var Tce=eG();rG.exports=Tce});var gG=s(function(sDe,oG){"use strict";var zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),iG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jce=require("@stdlib/utils/constant-function"),Mce=require("@stdlib/utils/noop"),xce=require("@stdlib/object/assign"),Gce=require("@stdlib/assert/is-positive-number").isPrimitive,Ace=require("@stdlib/assert/is-plain-object"),Vce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fce=require("@stdlib/assert/is-positive-integer").isPrimitive,Wce=require("@stdlib/assert/has-own-property"),nG=require("@stdlib/constants/float64/max"),aG=Xs().factory,sG=require("@stdlib/symbol/iterator"),Pv=require("@stdlib/string/format");function uG(r,e,i){var t,n,a,u,o;if(!Fce(r))throw new TypeError(Pv("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!Gce(e))throw new TypeError(Pv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Ace(i))throw new TypeError(Pv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=xce({},i),Wce(t,"iter")){if(!Vce(t.iter))throw new TypeError(Pv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=nG;a=aG(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=aG(r,e),t={iter:nG,state:a.state};return o=0,n={},zt(n,"next",g),zt(n,"return",d),t&&t.prng?(zt(n,"seed",null),zt(n,"seedLength",null),iG(n,"state",jce(null),Mce),zt(n,"stateLength",null),zt(n,"byteLength",null)):(Rv(n,"seed",c),Rv(n,"seedLength",p),iG(n,"state",l,v),Rv(n,"stateLength",y),Rv(n,"byteLength",f)),zt(n,"PRNG",a.PRNG),sG&&zt(n,sG,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return uG(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}oG.exports=uG});var fG=s(function(uDe,vG){"use strict";var Ice=gG();vG.exports=Ice});var yG=s(function(oDe,pG){"use strict";var kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),_v=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),dG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zce=require("@stdlib/utils/constant-function"),kce=require("@stdlib/utils/noop"),Jce=require("@stdlib/object/assign"),Uce=require("@stdlib/assert/is-positive-number").isPrimitive,Cce=require("@stdlib/assert/is-plain-object"),Bce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Xce=require("@stdlib/assert/has-own-property"),lG=require("@stdlib/constants/float64/max"),cG=sn().factory,mG=require("@stdlib/symbol/iterator"),pm=require("@stdlib/string/format");function hG(r,e){var i,t,n,a,u;if(!Uce(r))throw new TypeError(pm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Cce(e))throw new TypeError(pm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=Jce({},e),Xce(i,"iter")){if(!Bce(i.iter))throw new TypeError(pm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=lG;n=cG(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=cG(r),i={iter:lG,state:n.state};return u=0,t={},kt(t,"next",o),kt(t,"return",g),i&&i.prng?(kt(t,"seed",null),kt(t,"seedLength",null),dG(t,"state",zce(null),kce),kt(t,"stateLength",null),kt(t,"byteLength",null)):(_v(t,"seed",m),_v(t,"seedLength",c),dG(t,"state",f,l),_v(t,"stateLength",p),_v(t,"byteLength",y)),kt(t,"PRNG",n.PRNG),mG&&kt(t,mG,d),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function d(){return hG(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function p(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function f(){return n.PRNG.state}function l(v){n.PRNG.state=v}}pG.exports=hG});var bG=s(function(gDe,qG){"use strict";var Dce=yG();qG.exports=Dce});var PG=s(function(vDe,RG){"use strict";var Jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Yce=require("@stdlib/utils/constant-function"),Hce=require("@stdlib/utils/noop"),Zce=require("@stdlib/object/assign"),SG=require("@stdlib/assert/is-positive-number").isPrimitive,Qce=require("@stdlib/assert/is-plain-object"),$ce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kce=require("@stdlib/assert/has-own-property"),OG=require("@stdlib/constants/float64/max"),NG=Ds().factory,LG=require("@stdlib/symbol/iterator"),jv=require("@stdlib/string/format");function EG(r,e,i){var t,n,a,u,o;if(!SG(r))throw new TypeError(jv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!SG(e))throw new TypeError(jv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Qce(i))throw new TypeError(jv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Zce({},i),Kce(t,"iter")){if(!$ce(t.iter))throw new TypeError(jv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=OG;a=NG(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=NG(r,e),t={iter:OG,state:a.state};return o=0,n={},Jt(n,"next",g),Jt(n,"return",d),t&&t.prng?(Jt(n,"seed",null),Jt(n,"seedLength",null),wG(n,"state",Yce(null),Hce),Jt(n,"stateLength",null),Jt(n,"byteLength",null)):(Tv(n,"seed",c),Tv(n,"seedLength",p),wG(n,"state",l,v),Tv(n,"stateLength",y),Tv(n,"byteLength",f)),Jt(n,"PRNG",a.PRNG),LG&&Jt(n,LG,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return EG(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}RG.exports=EG});var TG=s(function(fDe,_G){"use strict";var eme=PG();_G.exports=eme});var WG=s(function(dDe,FG){"use strict";var Ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),jG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rme=require("@stdlib/utils/constant-function"),tme=require("@stdlib/utils/noop"),ime=require("@stdlib/object/assign"),MG=require("@stdlib/assert/is-positive-number").isPrimitive,nme=require("@stdlib/assert/is-plain-object"),ame=require("@stdlib/assert/is-number").isPrimitive,sme=require("@stdlib/math/base/assert/is-nan"),ume=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ome=require("@stdlib/assert/has-own-property"),xG=require("@stdlib/constants/float64/max"),GG=Ys().factory,AG=require("@stdlib/symbol/iterator"),cu=require("@stdlib/string/format");function VG(r,e,i,t){var n,a,u,o,g;if(!MG(r))throw new TypeError(cu("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!MG(e))throw new TypeError(cu("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(!ame(i)||sme(i))throw new TypeError(cu("invalid argument. Third argument must be a number. Value: `%s`.",i));if(arguments.length>3){if(!nme(t))throw new TypeError(cu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(n=ime({},t),ome(n,"iter")){if(!ume(n.iter))throw new TypeError(cu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=xG;u=GG(r,e,i,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=GG(r,e,i),n={iter:xG,state:u.state};return g=0,a={},Ut(a,"next",d),Ut(a,"return",m),n&&n.prng?(Ut(a,"seed",null),Ut(a,"seedLength",null),jG(a,"state",rme(null),tme),Ut(a,"stateLength",null),Ut(a,"byteLength",null)):(Mv(a,"seed",p),Mv(a,"seedLength",y),jG(a,"state",v,h),Mv(a,"stateLength",f),Mv(a,"byteLength",l)),Ut(a,"PRNG",u.PRNG),AG&&Ut(a,AG,c),a;function d(){return g+=1,o||g>n.iter?{done:!0}:{value:u(),done:!1}}function m(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function c(){return VG(r,e,i,n)}function p(){return u.PRNG.seed}function y(){return u.PRNG.seedLength}function f(){return u.PRNG.stateLength}function l(){return u.PRNG.byteLength}function v(){return u.PRNG.state}function h(q){u.PRNG.state=q}}FG.exports=VG});var zG=s(function(lDe,IG){"use strict";var gme=WG();IG.exports=gme});var YG=s(function(cDe,DG){"use strict";var Ct=require("@stdlib/utils/define-nonenumerable-read-only-property"),xv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),vme=require("@stdlib/utils/constant-function"),fme=require("@stdlib/utils/noop"),dme=require("@stdlib/object/assign"),JG=require("@stdlib/assert/is-positive-number").isPrimitive,lme=require("@stdlib/assert/is-plain-object"),cme=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,mme=require("@stdlib/assert/has-own-property"),UG=require("@stdlib/constants/float64/max"),CG=ze().factory,BG=require("@stdlib/symbol/iterator"),Gv=require("@stdlib/string/format");function XG(r,e,i){var t,n,a,u,o;if(!JG(r))throw new TypeError(Gv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!JG(e))throw new TypeError(Gv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!lme(i))throw new TypeError(Gv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=dme({},i),mme(t,"iter")){if(!cme(t.iter))throw new TypeError(Gv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=UG;a=CG(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=CG(r,e),t={iter:UG,state:a.state};return o=0,n={},Ct(n,"next",g),Ct(n,"return",d),t&&t.prng?(Ct(n,"seed",null),Ct(n,"seedLength",null),kG(n,"state",vme(null),fme),Ct(n,"stateLength",null),Ct(n,"byteLength",null)):(xv(n,"seed",c),xv(n,"seedLength",p),kG(n,"state",l,v),xv(n,"stateLength",y),xv(n,"byteLength",f)),Ct(n,"PRNG",a.PRNG),BG&&Ct(n,BG,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return XG(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}DG.exports=XG});var ZG=s(function(mDe,HG){"use strict";var hme=YG();HG.exports=hme});var iA=s(function(hDe,tA){"use strict";var Bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Av=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),QG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),pme=require("@stdlib/utils/constant-function"),yme=require("@stdlib/utils/noop"),qme=require("@stdlib/object/assign"),bme=require("@stdlib/assert/is-probability").isPrimitive,wme=require("@stdlib/assert/is-plain-object"),Sme=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ome=require("@stdlib/assert/has-own-property"),$G=require("@stdlib/constants/float64/max"),KG=aa().factory,eA=require("@stdlib/symbol/iterator"),ym=require("@stdlib/string/format");function rA(r,e){var i,t,n,a,u;if(!bme(r))throw new TypeError(ym("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!wme(e))throw new TypeError(ym("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=qme({},e),Ome(i,"iter")){if(!Sme(i.iter))throw new TypeError(ym("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=$G;n=KG(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=KG(r),i={iter:$G,state:n.state};return u=0,t={},Bt(t,"next",o),Bt(t,"return",g),i&&i.prng?(Bt(t,"seed",null),Bt(t,"seedLength",null),QG(t,"state",pme(null),yme),Bt(t,"stateLength",null),Bt(t,"byteLength",null)):(Av(t,"seed",m),Av(t,"seedLength",c),QG(t,"state",f,l),Av(t,"stateLength",p),Av(t,"byteLength",y)),Bt(t,"PRNG",n.PRNG),eA&&Bt(t,eA,d),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function d(){return rA(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function p(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function f(){return n.PRNG.state}function l(v){n.PRNG.state=v}}tA.exports=rA});var aA=s(function(pDe,nA){"use strict";var Nme=iA();nA.exports=Nme});var dA=s(function(yDe,fA){"use strict";var Xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lme=require("@stdlib/utils/constant-function"),Eme=require("@stdlib/utils/noop"),Rme=require("@stdlib/object/assign"),Pme=require("@stdlib/assert/is-number").isPrimitive,_me=require("@stdlib/math/base/assert/is-nan"),Tme=require("@stdlib/assert/is-plain-object"),jme=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mme=require("@stdlib/assert/is-positive-number").isPrimitive,xme=require("@stdlib/assert/has-own-property"),uA=require("@stdlib/constants/float64/max"),oA=Hs().factory,gA=require("@stdlib/symbol/iterator"),Fv=require("@stdlib/string/format");function vA(r,e,i){var t,n,a,u,o;if(!Pme(r)||_me(r))throw new TypeError(Fv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Mme(e))throw new TypeError(Fv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Tme(i))throw new TypeError(Fv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Rme({},i),xme(t,"iter")){if(!jme(t.iter))throw new TypeError(Fv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=uA;a=oA(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=oA(r,e),t={iter:uA,state:a.state};return o=0,n={},Xt(n,"next",g),Xt(n,"return",d),t&&t.prng?(Xt(n,"seed",null),Xt(n,"seedLength",null),sA(n,"state",Lme(null),Eme),Xt(n,"stateLength",null),Xt(n,"byteLength",null)):(Vv(n,"seed",c),Vv(n,"seedLength",p),sA(n,"state",l,v),Vv(n,"stateLength",y),Vv(n,"byteLength",f)),Xt(n,"PRNG",a.PRNG),gA&&Xt(n,gA,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return vA(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}fA.exports=vA});var cA=s(function(qDe,lA){"use strict";var Gme=dA();lA.exports=Gme});var wA=s(function(bDe,bA){"use strict";var Dt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),mA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ame=require("@stdlib/utils/constant-function"),Vme=require("@stdlib/utils/noop"),Fme=require("@stdlib/object/assign"),Wme=require("@stdlib/assert/is-plain-object"),Iv=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ime=require("@stdlib/assert/has-own-property"),hA=require("@stdlib/constants/float64/max"),pA=Qs().factory,yA=require("@stdlib/symbol/iterator"),fn=require("@stdlib/string/format");function qA(r,e,i,t){var n,a,u,o,g;if(!Iv(r))throw new TypeError(fn("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!Iv(e))throw new TypeError(fn("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!Iv(i))throw new TypeError(fn("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",i));if(i>r)throw new RangeError(fn("invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.",i));if(e>r)throw new RangeError(fn("invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.",e));if(arguments.length>3){if(!Wme(t))throw new TypeError(fn("invalid argument. Options argument must be an object. Value: `%s`.",t));if(n=Fme({},t),Ime(n,"iter")){if(!Iv(n.iter))throw new TypeError(fn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=hA;u=pA(r,e,i,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=pA(r,e,i),n={iter:hA,state:u.state};return g=0,a={},Dt(a,"next",d),Dt(a,"return",m),n&&n.prng?(Dt(a,"seed",null),Dt(a,"seedLength",null),mA(a,"state",Ame(null),Vme),Dt(a,"stateLength",null),Dt(a,"byteLength",null)):(Wv(a,"seed",p),Wv(a,"seedLength",y),mA(a,"state",v,h),Wv(a,"stateLength",f),Wv(a,"byteLength",l)),Dt(a,"PRNG",u.PRNG),yA&&Dt(a,yA,c),a;function d(){return g+=1,o||g>n.iter?{done:!0}:{value:u(),done:!1}}function m(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function c(){return qA(r,e,i,n)}function p(){return u.PRNG.seed}function y(){return u.PRNG.seedLength}function f(){return u.PRNG.stateLength}function l(){return u.PRNG.byteLength}function v(){return u.PRNG.state}function h(q){u.PRNG.state=q}}bA.exports=qA});var OA=s(function(wDe,SA){"use strict";var zme=wA();SA.exports=zme});var jA=s(function(SDe,TA){"use strict";var Yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),zv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kme=require("@stdlib/utils/constant-function"),Jme=require("@stdlib/utils/noop"),Ume=require("@stdlib/object/assign"),Cme=require("@stdlib/assert/is-plain-object"),Bme=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Xme=require("@stdlib/assert/has-own-property"),LA=require("@stdlib/constants/float64/max"),EA=Y().factory,RA=require("@stdlib/symbol/iterator"),PA=require("@stdlib/string/format");function _A(r){var e,i,t,n,a;if(arguments.length>0){if(!Cme(r))throw new TypeError(PA("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Ume({},r),Xme(e,"iter")){if(!Bme(e.iter))throw new TypeError(PA("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=LA;t=EA(e),e.prng===void 0&&e.copy!==!1&&(e.state=t.state)}else t=EA(),e={iter:LA,state:t.state};return a=0,i={},Yt(i,"next",u),Yt(i,"return",o),e&&e.prng?(Yt(i,"seed",null),Yt(i,"seedLength",null),NA(i,"state",kme(null),Jme),Yt(i,"stateLength",null),Yt(i,"byteLength",null)):(zv(i,"seed",d),zv(i,"seedLength",m),NA(i,"state",y,f),zv(i,"stateLength",c),zv(i,"byteLength",p)),Yt(i,"PRNG",t.PRNG),RA&&Yt(i,RA,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return _A(e)}function d(){return t.PRNG.seed}function m(){return t.PRNG.seedLength}function c(){return t.PRNG.stateLength}function p(){return t.PRNG.byteLength}function y(){return t.PRNG.state}function f(l){t.PRNG.state=l}}TA.exports=_A});var xA=s(function(ODe,MA){"use strict";var Dme=jA();MA.exports=Dme});var kA=s(function(NDe,zA){"use strict";var Ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),kv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),GA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Yme=require("@stdlib/utils/constant-function"),Hme=require("@stdlib/utils/noop"),Zme=require("@stdlib/object/assign"),AA=require("@stdlib/assert/is-positive-number").isPrimitive,Qme=require("@stdlib/assert/is-plain-object"),$me=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kme=require("@stdlib/assert/has-own-property"),VA=require("@stdlib/constants/float64/max"),FA=un().factory,WA=require("@stdlib/symbol/iterator"),Jv=require("@stdlib/string/format");function IA(r,e,i){var t,n,a,u,o;if(!AA(r))throw new TypeError(Jv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!AA(e))throw new TypeError(Jv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Qme(i))throw new TypeError(Jv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Zme({},i),Kme(t,"iter")){if(!$me(t.iter))throw new TypeError(Jv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=VA;a=FA(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=FA(r,e),t={iter:VA,state:a.state};return o=0,n={},Ht(n,"next",g),Ht(n,"return",d),t&&t.prng?(Ht(n,"seed",null),Ht(n,"seedLength",null),GA(n,"state",Yme(null),Hme),Ht(n,"stateLength",null),Ht(n,"byteLength",null)):(kv(n,"seed",c),kv(n,"seedLength",p),GA(n,"state",l,v),kv(n,"stateLength",y),kv(n,"byteLength",f)),Ht(n,"PRNG",a.PRNG),WA&&Ht(n,WA,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return IA(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}zA.exports=IA});var UA=s(function(LDe,JA){"use strict";var ehe=kA();JA.exports=ehe});var QA=s(function(EDe,ZA){"use strict";var Zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),CA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rhe=require("@stdlib/utils/constant-function"),the=require("@stdlib/utils/noop"),ihe=require("@stdlib/object/assign"),BA=require("@stdlib/assert/is-positive-number").isPrimitive,nhe=require("@stdlib/assert/is-plain-object"),ahe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,she=require("@stdlib/assert/has-own-property"),XA=require("@stdlib/constants/float64/max"),DA=$s().factory,YA=require("@stdlib/symbol/iterator"),Cv=require("@stdlib/string/format");function HA(r,e,i){var t,n,a,u,o;if(!BA(r))throw new TypeError(Cv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!BA(e))throw new TypeError(Cv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!nhe(i))throw new TypeError(Cv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=ihe({},i),she(t,"iter")){if(!ahe(t.iter))throw new TypeError(Cv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=XA;a=DA(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=DA(r,e),t={iter:XA,state:a.state};return o=0,n={},Zt(n,"next",g),Zt(n,"return",d),t&&t.prng?(Zt(n,"seed",null),Zt(n,"seedLength",null),CA(n,"state",rhe(null),the),Zt(n,"stateLength",null),Zt(n,"byteLength",null)):(Uv(n,"seed",c),Uv(n,"seedLength",p),CA(n,"state",l,v),Uv(n,"stateLength",y),Uv(n,"byteLength",f)),Zt(n,"PRNG",a.PRNG),YA&&Zt(n,YA,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return HA(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}ZA.exports=HA});var KA=s(function(RDe,$A){"use strict";var uhe=QA();$A.exports=uhe});var sV=s(function(PDe,aV){"use strict";var Qt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),eV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ohe=require("@stdlib/utils/constant-function"),ghe=require("@stdlib/utils/noop"),vhe=require("@stdlib/object/assign"),fhe=require("@stdlib/assert/is-number").isPrimitive,dhe=require("@stdlib/math/base/assert/is-nan"),lhe=require("@stdlib/assert/is-plain-object"),che=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,mhe=require("@stdlib/assert/is-positive-number").isPrimitive,hhe=require("@stdlib/assert/has-own-property"),rV=require("@stdlib/constants/float64/max"),tV=Ks().factory,iV=require("@stdlib/symbol/iterator"),Xv=require("@stdlib/string/format");function nV(r,e,i){var t,n,a,u,o;if(!fhe(r)||dhe(r))throw new TypeError(Xv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!mhe(e))throw new TypeError(Xv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!lhe(i))throw new TypeError(Xv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=vhe({},i),hhe(t,"iter")){if(!che(t.iter))throw new TypeError(Xv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=rV;a=tV(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=tV(r,e),t={iter:rV,state:a.state};return o=0,n={},Qt(n,"next",g),Qt(n,"return",d),t&&t.prng?(Qt(n,"seed",null),Qt(n,"seedLength",null),eV(n,"state",ohe(null),ghe),Qt(n,"stateLength",null),Qt(n,"byteLength",null)):(Bv(n,"seed",c),Bv(n,"seedLength",p),eV(n,"state",l,v),Bv(n,"stateLength",y),Bv(n,"byteLength",f)),Qt(n,"PRNG",a.PRNG),iV&&Qt(n,iV,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return nV(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}aV.exports=nV});var oV=s(function(_De,uV){"use strict";var phe=sV();uV.exports=phe});var mV=s(function(TDe,cV){"use strict";var $t=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),gV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),yhe=require("@stdlib/utils/constant-function"),qhe=require("@stdlib/utils/noop"),bhe=require("@stdlib/object/assign"),whe=require("@stdlib/assert/is-number").isPrimitive,She=require("@stdlib/math/base/assert/is-nan"),Ohe=require("@stdlib/assert/is-plain-object"),Nhe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Lhe=require("@stdlib/assert/is-positive-number").isPrimitive,Ehe=require("@stdlib/assert/has-own-property"),vV=require("@stdlib/constants/float64/max"),fV=eu().factory,dV=require("@stdlib/symbol/iterator"),Yv=require("@stdlib/string/format");function lV(r,e,i){var t,n,a,u,o;if(!whe(r)||She(r))throw new TypeError(Yv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Lhe(e))throw new TypeError(Yv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Ohe(i))throw new TypeError(Yv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=bhe({},i),Ehe(t,"iter")){if(!Nhe(t.iter))throw new TypeError(Yv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=vV;a=fV(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=fV(r,e),t={iter:vV,state:a.state};return o=0,n={},$t(n,"next",g),$t(n,"return",d),t&&t.prng?($t(n,"seed",null),$t(n,"seedLength",null),gV(n,"state",yhe(null),qhe),$t(n,"stateLength",null),$t(n,"byteLength",null)):(Dv(n,"seed",c),Dv(n,"seedLength",p),gV(n,"state",l,v),Dv(n,"stateLength",y),Dv(n,"byteLength",f)),$t(n,"PRNG",a.PRNG),dV&&$t(n,dV,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return lV(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}cV.exports=lV});var pV=s(function(jDe,hV){"use strict";var Rhe=mV();hV.exports=Rhe});var NV=s(function(MDe,OV){"use strict";var Kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Phe=require("@stdlib/utils/constant-function"),_he=require("@stdlib/utils/noop"),The=require("@stdlib/object/assign"),jhe=require("@stdlib/assert/is-number").isPrimitive,Mhe=require("@stdlib/math/base/assert/is-nan"),xhe=require("@stdlib/assert/is-plain-object"),Ghe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ahe=require("@stdlib/assert/is-positive-number").isPrimitive,Vhe=require("@stdlib/assert/has-own-property"),qV=require("@stdlib/constants/float64/max"),bV=ru().factory,wV=require("@stdlib/symbol/iterator"),Zv=require("@stdlib/string/format");function SV(r,e,i){var t,n,a,u,o;if(!jhe(r)||Mhe(r))throw new TypeError(Zv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Ahe(e))throw new TypeError(Zv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!xhe(i))throw new TypeError(Zv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=The({},i),Vhe(t,"iter")){if(!Ghe(t.iter))throw new TypeError(Zv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=qV;a=bV(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=bV(r,e),t={iter:qV,state:a.state};return o=0,n={},Kt(n,"next",g),Kt(n,"return",d),t&&t.prng?(Kt(n,"seed",null),Kt(n,"seedLength",null),yV(n,"state",Phe(null),_he),Kt(n,"stateLength",null),Kt(n,"byteLength",null)):(Hv(n,"seed",c),Hv(n,"seedLength",p),yV(n,"state",l,v),Hv(n,"stateLength",y),Hv(n,"byteLength",f)),Kt(n,"PRNG",a.PRNG),wV&&Kt(n,wV,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return SV(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}OV.exports=SV});var EV=s(function(xDe,LV){"use strict";var Fhe=NV();LV.exports=Fhe});var xV=s(function(GDe,MV){"use strict";var ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Whe=require("@stdlib/utils/constant-function"),Ihe=require("@stdlib/utils/noop"),zhe=require("@stdlib/object/assign"),khe=require("@stdlib/assert/is-number").isPrimitive,Jhe=require("@stdlib/math/base/assert/is-nan"),Uhe=require("@stdlib/assert/is-plain-object"),Che=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Bhe=require("@stdlib/assert/is-positive-number").isPrimitive,Xhe=require("@stdlib/assert/has-own-property"),PV=require("@stdlib/constants/float64/max"),_V=on().factory,TV=require("@stdlib/symbol/iterator"),$v=require("@stdlib/string/format");function jV(r,e,i){var t,n,a,u,o;if(!khe(r)||Jhe(r))throw new TypeError($v("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Bhe(e))throw new TypeError($v("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Uhe(i))throw new TypeError($v("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=zhe({},i),Xhe(t,"iter")){if(!Che(t.iter))throw new TypeError($v("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=PV;a=_V(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=_V(r,e),t={iter:PV,state:a.state};return o=0,n={},ei(n,"next",g),ei(n,"return",d),t&&t.prng?(ei(n,"seed",null),ei(n,"seedLength",null),RV(n,"state",Whe(null),Ihe),ei(n,"stateLength",null),ei(n,"byteLength",null)):(Qv(n,"seed",c),Qv(n,"seedLength",p),RV(n,"state",l,v),Qv(n,"stateLength",y),Qv(n,"byteLength",f)),ei(n,"PRNG",a.PRNG),TV&&ei(n,TV,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return jV(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}MV.exports=jV});var AV=s(function(ADe,GV){"use strict";var Dhe=xV();GV.exports=Dhe});var JV=s(function(VDe,kV){"use strict";var qm=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Yhe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Hhe=require("@stdlib/object/assign"),Zhe=require("@stdlib/assert/is-plain-object"),Qhe=require("@stdlib/assert/is-boolean").isPrimitive,$he=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,VV=require("@stdlib/assert/has-own-property"),FV=require("@stdlib/constants/float64/max"),WV=H().factory,IV=require("@stdlib/symbol/iterator"),bm=require("@stdlib/string/format");function zV(r){var e,i,t,n,a;if(arguments.length>0){if(!Zhe(r))throw new TypeError(bm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Hhe({},r),VV(e,"normalized")&&!Qhe(e.normalized))throw new TypeError(bm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(VV(e,"iter")){if(!$he(e.iter))throw new TypeError(bm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=FV;t=WV(e),e.copy!==!1&&(e.state=t.state)}else t=WV(),e={iter:FV,state:t.state};return e.normalized&&(t=t.normalized),a=0,i={},qm(i,"next",u),qm(i,"return",o),Kv(i,"seed",d),Kv(i,"seedLength",m),Yhe(i,"state",y,f),Kv(i,"stateLength",c),Kv(i,"byteLength",p),IV&&qm(i,IV,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return zV(e)}function d(){return t.seed}function m(){return t.seedLength}function c(){return t.stateLength}function p(){return t.byteLength}function y(){return t.state}function f(l){t.state=l}}kV.exports=zV});var CV=s(function(FDe,UV){"use strict";var Khe=JV();UV.exports=Khe});var QV=s(function(WDe,ZV){"use strict";var wm=require("@stdlib/utils/define-nonenumerable-read-only-property"),ef=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),epe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rpe=require("@stdlib/object/assign"),tpe=require("@stdlib/assert/is-plain-object"),ipe=require("@stdlib/assert/is-boolean").isPrimitive,npe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,BV=require("@stdlib/assert/has-own-property"),XV=require("@stdlib/constants/float64/max"),DV=Q().factory,YV=require("@stdlib/symbol/iterator"),Sm=require("@stdlib/string/format");function HV(r){var e,i,t,n,a;if(arguments.length>0){if(!tpe(r))throw new TypeError(Sm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=rpe({},r),BV(e,"normalized")&&!ipe(e.normalized))throw new TypeError(Sm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(BV(e,"iter")){if(!npe(e.iter))throw new TypeError(Sm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=XV;t=DV(e),e.copy!==!1&&(e.state=t.state)}else t=DV(),e={iter:XV,state:t.state};return e.normalized&&(t=t.normalized),a=0,i={},wm(i,"next",u),wm(i,"return",o),ef(i,"seed",d),ef(i,"seedLength",m),epe(i,"state",y,f),ef(i,"stateLength",c),ef(i,"byteLength",p),YV&&wm(i,YV,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return HV(e)}function d(){return t.seed}function m(){return t.seedLength}function c(){return t.stateLength}function p(){return t.byteLength}function y(){return t.state}function f(l){t.state=l}}ZV.exports=HV});var KV=s(function(IDe,$V){"use strict";var ape=QV();$V.exports=ape});var s2=s(function(zDe,a2){"use strict";var Om=require("@stdlib/utils/define-nonenumerable-read-only-property"),rf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),spe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),upe=require("@stdlib/object/assign"),ope=require("@stdlib/assert/is-plain-object"),gpe=require("@stdlib/assert/is-boolean").isPrimitive,vpe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,e2=require("@stdlib/assert/has-own-property"),r2=require("@stdlib/constants/float64/max"),t2=j().factory,i2=require("@stdlib/symbol/iterator"),Nm=require("@stdlib/string/format");function n2(r){var e,i,t,n,a;if(arguments.length>0){if(!ope(r))throw new TypeError(Nm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=upe({},r),e2(e,"normalized")&&!gpe(e.normalized))throw new TypeError(Nm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(e2(e,"iter")){if(!vpe(e.iter))throw new TypeError(Nm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=r2;t=t2(e),e.copy!==!1&&(e.state=t.state)}else t=t2(),e={iter:r2,state:t.state};return e.normalized&&(t=t.normalized),a=0,i={},Om(i,"next",u),Om(i,"return",o),rf(i,"seed",d),rf(i,"seedLength",m),spe(i,"state",y,f),rf(i,"stateLength",c),rf(i,"byteLength",p),i2&&Om(i,i2,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return n2(e)}function d(){return t.seed}function m(){return t.seedLength}function c(){return t.stateLength}function p(){return t.byteLength}function y(){return t.state}function f(l){t.state=l}}a2.exports=n2});var o2=s(function(kDe,u2){"use strict";var fpe=s2();u2.exports=fpe});var m2=s(function(JDe,c2){"use strict";var ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),tf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),g2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dpe=require("@stdlib/utils/constant-function"),lpe=require("@stdlib/utils/noop"),cpe=require("@stdlib/object/assign"),mpe=require("@stdlib/assert/is-probability").isPrimitive,hpe=require("@stdlib/assert/is-plain-object"),ppe=require("@stdlib/assert/is-positive-number").isPrimitive,ype=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qpe=require("@stdlib/assert/has-own-property"),v2=require("@stdlib/constants/float64/max"),f2=tu().factory,d2=require("@stdlib/symbol/iterator"),nf=require("@stdlib/string/format");function l2(r,e,i){var t,n,a,u,o;if(!ppe(r))throw new TypeError(nf("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!mpe(e))throw new TypeError(nf("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!hpe(i))throw new TypeError(nf("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=cpe({},i),qpe(t,"iter")){if(!ype(t.iter))throw new TypeError(nf("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=v2;a=f2(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=f2(r,e),t={iter:v2,state:a.state};return o=0,n={},ri(n,"next",g),ri(n,"return",d),t&&t.prng?(ri(n,"seed",null),ri(n,"seedLength",null),g2(n,"state",dpe(null),lpe),ri(n,"stateLength",null),ri(n,"byteLength",null)):(tf(n,"seed",c),tf(n,"seedLength",p),g2(n,"state",l,v),tf(n,"stateLength",y),tf(n,"byteLength",f)),ri(n,"PRNG",a.PRNG),d2&&ri(n,d2,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return l2(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}c2.exports=l2});var p2=s(function(UDe,h2){"use strict";var bpe=m2();h2.exports=bpe});var N2=s(function(CDe,O2){"use strict";var ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),af=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),y2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wpe=require("@stdlib/utils/constant-function"),Spe=require("@stdlib/utils/noop"),Ope=require("@stdlib/object/assign"),Npe=require("@stdlib/assert/is-number").isPrimitive,Lpe=require("@stdlib/math/base/assert/is-nan"),Epe=require("@stdlib/assert/is-plain-object"),Rpe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ppe=require("@stdlib/assert/is-positive-number").isPrimitive,_pe=require("@stdlib/assert/has-own-property"),q2=require("@stdlib/constants/float64/max"),b2=gn().factory,w2=require("@stdlib/symbol/iterator"),sf=require("@stdlib/string/format");function S2(r,e,i){var t,n,a,u,o;if(!Npe(r)||Lpe(r))throw new TypeError(sf("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Ppe(e))throw new TypeError(sf("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Epe(i))throw new TypeError(sf("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Ope({},i),_pe(t,"iter")){if(!Rpe(t.iter))throw new TypeError(sf("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=q2;a=b2(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=b2(r,e),t={iter:q2,state:a.state};return o=0,n={},ti(n,"next",g),ti(n,"return",d),t&&t.prng?(ti(n,"seed",null),ti(n,"seedLength",null),y2(n,"state",wpe(null),Spe),ti(n,"stateLength",null),ti(n,"byteLength",null)):(af(n,"seed",c),af(n,"seedLength",p),y2(n,"state",l,v),af(n,"stateLength",y),af(n,"byteLength",f)),ti(n,"PRNG",a.PRNG),w2&&ti(n,w2,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return S2(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}O2.exports=S2});var E2=s(function(BDe,L2){"use strict";var Tpe=N2();L2.exports=Tpe});var G2=s(function(XDe,x2){"use strict";var ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),uf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),R2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jpe=require("@stdlib/utils/constant-function"),Mpe=require("@stdlib/utils/noop"),xpe=require("@stdlib/object/assign"),P2=require("@stdlib/assert/is-positive-number").isPrimitive,Gpe=require("@stdlib/assert/is-plain-object"),Ape=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vpe=require("@stdlib/assert/has-own-property"),_2=require("@stdlib/constants/float64/max"),T2=iu().factory,j2=require("@stdlib/symbol/iterator"),of=require("@stdlib/string/format");function M2(r,e,i){var t,n,a,u,o;if(!P2(r))throw new TypeError(of("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!P2(e))throw new TypeError(of("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Gpe(i))throw new TypeError(of("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=xpe({},i),Vpe(t,"iter")){if(!Ape(t.iter))throw new TypeError(of("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=_2;a=T2(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=T2(r,e),t={iter:_2,state:a.state};return o=0,n={},ii(n,"next",g),ii(n,"return",d),t&&t.prng?(ii(n,"seed",null),ii(n,"seedLength",null),R2(n,"state",jpe(null),Mpe),ii(n,"stateLength",null),ii(n,"byteLength",null)):(uf(n,"seed",c),uf(n,"seedLength",p),R2(n,"state",l,v),uf(n,"stateLength",y),uf(n,"byteLength",f)),ii(n,"PRNG",a.PRNG),j2&&ii(n,j2,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return M2(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}x2.exports=M2});var V2=s(function(DDe,A2){"use strict";var Fpe=G2();A2.exports=Fpe});var U2=s(function(YDe,J2){"use strict";var ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),gf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),F2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Wpe=require("@stdlib/utils/constant-function"),Ipe=require("@stdlib/utils/noop"),zpe=require("@stdlib/object/assign"),kpe=require("@stdlib/assert/is-positive-number").isPrimitive,Jpe=require("@stdlib/assert/is-plain-object"),Upe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Cpe=require("@stdlib/assert/has-own-property"),W2=require("@stdlib/constants/float64/max"),I2=pa().factory,z2=require("@stdlib/symbol/iterator"),Lm=require("@stdlib/string/format");function k2(r,e){var i,t,n,a,u;if(!kpe(r))throw new TypeError(Lm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Jpe(e))throw new TypeError(Lm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=zpe({},e),Cpe(i,"iter")){if(!Upe(i.iter))throw new TypeError(Lm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=W2;n=I2(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=I2(r),i={iter:W2,state:n.state};return u=0,t={},ni(t,"next",o),ni(t,"return",g),i&&i.prng?(ni(t,"seed",null),ni(t,"seedLength",null),F2(t,"state",Wpe(null),Ipe),ni(t,"stateLength",null),ni(t,"byteLength",null)):(gf(t,"seed",m),gf(t,"seedLength",c),F2(t,"state",f,l),gf(t,"stateLength",p),gf(t,"byteLength",y)),ni(t,"PRNG",n.PRNG),z2&&ni(t,z2,d),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function d(){return k2(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function p(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function f(){return n.PRNG.state}function l(v){n.PRNG.state=v}}J2.exports=k2});var B2=s(function(HDe,C2){"use strict";var Bpe=U2();C2.exports=Bpe});var $2=s(function(ZDe,Q2){"use strict";var vf=require("@stdlib/utils/define-nonenumerable-read-only-property"),ff=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Xpe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Dpe=require("@stdlib/object/assign"),Ype=require("@stdlib/assert/is-plain-object"),Hpe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zpe=require("@stdlib/assert/has-own-property"),X2=require("@stdlib/constants/float64/max"),D2=su().factory,Y2=require("@stdlib/symbol/iterator"),H2=require("@stdlib/string/format");function Z2(r){var e,i,t,n,a;if(arguments.length>0){if(!Ype(r))throw new TypeError(H2("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Dpe({},r),Zpe(e,"iter")){if(!Hpe(e.iter))throw new TypeError(H2("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=X2;t=D2(e),e.copy!==!1&&(e.state=t.state)}else t=D2(),e={iter:X2,state:t.state};return a=0,i={},vf(i,"next",u),vf(i,"return",o),ff(i,"seed",d),ff(i,"seedLength",m),Xpe(i,"state",y,f),ff(i,"stateLength",c),ff(i,"byteLength",p),vf(i,"PRNG",t.PRNG),Y2&&vf(i,Y2,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return Z2(e)}function d(){return t.PRNG.seed}function m(){return t.PRNG.seedLength}function c(){return t.PRNG.stateLength}function p(){return t.PRNG.byteLength}function y(){return t.PRNG.state}function f(l){t.PRNG.state=l}}Q2.exports=Z2});var eF=s(function(QDe,K2){"use strict";var Qpe=$2();K2.exports=Qpe});var oF=s(function($De,uF){"use strict";var ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),df=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),rF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$pe=require("@stdlib/utils/constant-function"),Kpe=require("@stdlib/utils/noop"),eye=require("@stdlib/object/assign"),rye=require("@stdlib/assert/is-plain-object"),tye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,iye=require("@stdlib/assert/has-own-property"),tF=require("@stdlib/constants/float64/max"),iF=ou().factory,nF=require("@stdlib/symbol/iterator"),aF=require("@stdlib/string/format");function sF(r){var e,i,t,n,a;if(arguments.length>0){if(!rye(r))throw new TypeError(aF("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=eye({},r),iye(e,"iter")){if(!tye(e.iter))throw new TypeError(aF("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=tF;t=iF(e),e.prng===void 0&&e.copy!==!1&&(e.state=t.state)}else t=iF(),e={iter:tF,state:t.state};return a=0,i={},ai(i,"next",u),ai(i,"return",o),e&&e.prng?(ai(i,"seed",null),ai(i,"seedLength",null),rF(i,"state",$pe(null),Kpe),ai(i,"stateLength",null),ai(i,"byteLength",null)):(df(i,"seed",d),df(i,"seedLength",m),rF(i,"state",y,f),df(i,"stateLength",c),df(i,"byteLength",p)),ai(i,"PRNG",t.PRNG),nF&&ai(i,nF,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return sF(e)}function d(){return t.PRNG.seed}function m(){return t.PRNG.seedLength}function c(){return t.PRNG.stateLength}function p(){return t.PRNG.byteLength}function y(){return t.PRNG.state}function f(l){t.PRNG.state=l}}uF.exports=sF});var vF=s(function(KDe,gF){"use strict";var nye=oF();gF.exports=nye});var pF=s(function(e5e,hF){"use strict";var lf=require("@stdlib/utils/define-nonenumerable-read-only-property"),cf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),aye=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),sye=require("@stdlib/object/assign"),uye=require("@stdlib/assert/is-plain-object"),oye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,gye=require("@stdlib/assert/has-own-property"),fF=require("@stdlib/constants/float64/max"),dF=qt().factory,lF=require("@stdlib/symbol/iterator"),cF=require("@stdlib/string/format");function mF(r){var e,i,t,n,a;if(arguments.length>0){if(!uye(r))throw new TypeError(cF("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=sye({},r),gye(e,"iter")){if(!oye(e.iter))throw new TypeError(cF("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=fF;t=dF(e),e.copy!==!1&&(e.state=t.state)}else t=dF(),e={iter:fF,state:t.state};return a=0,i={},lf(i,"next",u),lf(i,"return",o),cf(i,"seed",d),cf(i,"seedLength",m),aye(i,"state",y,f),cf(i,"stateLength",c),cf(i,"byteLength",p),lf(i,"PRNG",t.PRNG),lF&&lf(i,lF,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return mF(e)}function d(){return t.PRNG.seed}function m(){return t.PRNG.seedLength}function c(){return t.PRNG.stateLength}function p(){return t.PRNG.byteLength}function y(){return t.PRNG.state}function f(l){t.PRNG.state=l}}hF.exports=mF});var qF=s(function(r5e,yF){"use strict";var vye=pF();yF.exports=vye});var EF=s(function(t5e,LF){"use strict";var si=require("@stdlib/utils/define-nonenumerable-read-only-property"),mf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fye=require("@stdlib/utils/constant-function"),dye=require("@stdlib/utils/noop"),lye=require("@stdlib/object/assign"),cye=require("@stdlib/assert/is-positive-number").isPrimitive,mye=require("@stdlib/assert/is-plain-object"),hye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,pye=require("@stdlib/assert/has-own-property"),wF=require("@stdlib/constants/float64/max"),SF=gu().factory,OF=require("@stdlib/symbol/iterator"),Em=require("@stdlib/string/format");function NF(r,e){var i,t,n,a,u;if(!cye(r))throw new TypeError(Em("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!mye(e))throw new TypeError(Em("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=lye({},e),pye(i,"iter")){if(!hye(i.iter))throw new TypeError(Em("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=wF;n=SF(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=SF(r),i={iter:wF,state:n.state};return u=0,t={},si(t,"next",o),si(t,"return",g),i&&i.prng?(si(t,"seed",null),si(t,"seedLength",null),bF(t,"state",fye(null),dye),si(t,"stateLength",null),si(t,"byteLength",null)):(mf(t,"seed",m),mf(t,"seedLength",c),bF(t,"state",f,l),mf(t,"stateLength",p),mf(t,"byteLength",y)),si(t,"PRNG",n.PRNG),OF&&si(t,OF,d),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function d(){return NF(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function p(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function f(){return n.PRNG.state}function l(v){n.PRNG.state=v}}LF.exports=NF});var PF=s(function(i5e,RF){"use strict";var yye=EF();RF.exports=yye});var AF=s(function(n5e,GF){"use strict";var ui=require("@stdlib/utils/define-nonenumerable-read-only-property"),hf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_F=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qye=require("@stdlib/utils/constant-function"),bye=require("@stdlib/utils/noop"),wye=require("@stdlib/object/assign"),Sye=require("@stdlib/assert/is-positive-number").isPrimitive,Oye=require("@stdlib/assert/is-plain-object"),Nye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Lye=require("@stdlib/assert/has-own-property"),TF=require("@stdlib/constants/float64/max"),jF=vu().factory,MF=require("@stdlib/symbol/iterator"),Rm=require("@stdlib/string/format");function xF(r,e){var i,t,n,a,u;if(!Sye(r))throw new TypeError(Rm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Oye(e))throw new TypeError(Rm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=wye({},e),Lye(i,"iter")){if(!Nye(i.iter))throw new TypeError(Rm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=TF;n=jF(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=jF(r),i={iter:TF,state:n.state};return u=0,t={},ui(t,"next",o),ui(t,"return",g),i&&i.prng?(ui(t,"seed",null),ui(t,"seedLength",null),_F(t,"state",qye(null),bye),ui(t,"stateLength",null),ui(t,"byteLength",null)):(hf(t,"seed",m),hf(t,"seedLength",c),_F(t,"state",f,l),hf(t,"stateLength",p),hf(t,"byteLength",y)),ui(t,"PRNG",n.PRNG),MF&&ui(t,MF,d),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function d(){return xF(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function p(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function f(){return n.PRNG.state}function l(v){n.PRNG.state=v}}GF.exports=xF});var FF=s(function(a5e,VF){"use strict";var Eye=AF();VF.exports=Eye});var CF=s(function(s5e,UF){"use strict";var oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),pf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),WF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Rye=require("@stdlib/utils/constant-function"),Pye=require("@stdlib/utils/noop"),_ye=require("@stdlib/object/assign"),Pm=require("@stdlib/assert/is-number").isPrimitive,_m=require("@stdlib/math/base/assert/is-nan"),Tye=require("@stdlib/assert/is-plain-object"),jye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mye=require("@stdlib/assert/has-own-property"),IF=require("@stdlib/constants/float64/max"),zF=fu().factory,kF=require("@stdlib/symbol/iterator"),Na=require("@stdlib/string/format");function JF(r,e,i,t){var n,a,u,o,g;if(!Pm(r)||_m(r))throw new TypeError(Na("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Pm(e)||_m(e))throw new TypeError(Na("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!Pm(i)||_m(i))throw new TypeError(Na("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",i));if(!(r<=i&&i<=e))throw new RangeError(Na("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,i));if(arguments.length>3){if(!Tye(t))throw new TypeError(Na("invalid argument. Options argument must be an object. Value: `%s`.",t));if(n=_ye({},t),Mye(n,"iter")){if(!jye(n.iter))throw new TypeError(Na("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=IF;u=zF(r,e,i,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=zF(r,e,i),n={iter:IF,state:u.state};return g=0,a={},oi(a,"next",d),oi(a,"return",m),n&&n.prng?(oi(a,"seed",null),oi(a,"seedLength",null),WF(a,"state",Rye(null),Pye),oi(a,"stateLength",null),oi(a,"byteLength",null)):(pf(a,"seed",p),pf(a,"seedLength",y),WF(a,"state",v,h),pf(a,"stateLength",f),pf(a,"byteLength",l)),oi(a,"PRNG",u.PRNG),kF&&oi(a,kF,c),a;function d(){return g+=1,o||g>n.iter?{done:!0}:{value:u(),done:!1}}function m(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function c(){return JF(r,e,i,n)}function p(){return u.PRNG.seed}function y(){return u.PRNG.seedLength}function f(){return u.PRNG.stateLength}function l(){return u.PRNG.byteLength}function v(){return u.PRNG.state}function h(q){u.PRNG.state=q}}UF.exports=JF});var XF=s(function(u5e,BF){"use strict";var xye=CF();BF.exports=xye});var rW=s(function(o5e,eW){"use strict";var gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),yf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),DF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Gye=require("@stdlib/utils/constant-function"),Aye=require("@stdlib/utils/noop"),Vye=require("@stdlib/object/assign"),YF=require("@stdlib/assert/is-number").isPrimitive,HF=require("@stdlib/math/base/assert/is-nan"),Fye=require("@stdlib/assert/is-plain-object"),Wye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Iye=require("@stdlib/assert/has-own-property"),ZF=require("@stdlib/constants/float64/max"),QF=vn().factory,$F=require("@stdlib/symbol/iterator"),mu=require("@stdlib/string/format");function KF(r,e,i){var t,n,a,u,o;if(!YF(r)||HF(r))throw new TypeError(mu("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!YF(e)||HF(e))throw new TypeError(mu("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(mu("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(arguments.length>2){if(!Fye(i))throw new TypeError(mu("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Vye({},i),Iye(t,"iter")){if(!Wye(t.iter))throw new TypeError(mu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=ZF;a=QF(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=QF(r,e),t={iter:ZF,state:a.state};return o=0,n={},gi(n,"next",g),gi(n,"return",d),t&&t.prng?(gi(n,"seed",null),gi(n,"seedLength",null),DF(n,"state",Gye(null),Aye),gi(n,"stateLength",null),gi(n,"byteLength",null)):(yf(n,"seed",c),yf(n,"seedLength",p),DF(n,"state",l,v),yf(n,"stateLength",y),yf(n,"byteLength",f)),gi(n,"PRNG",a.PRNG),$F&&gi(n,$F,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return KF(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}eW.exports=KF});var iW=s(function(g5e,tW){"use strict";var zye=rW();tW.exports=zye});var fW=s(function(v5e,vW){"use strict";var vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),qf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),nW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kye=require("@stdlib/utils/constant-function"),Jye=require("@stdlib/utils/noop"),Uye=require("@stdlib/object/assign"),aW=require("@stdlib/assert/is-positive-number").isPrimitive,Cye=require("@stdlib/assert/is-plain-object"),Bye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Xye=require("@stdlib/assert/has-own-property"),sW=require("@stdlib/constants/float64/max"),uW=Oa().factory,oW=require("@stdlib/symbol/iterator"),bf=require("@stdlib/string/format");function gW(r,e,i){var t,n,a,u,o;if(!aW(r))throw new TypeError(bf("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!aW(e))throw new TypeError(bf("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Cye(i))throw new TypeError(bf("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Uye({},i),Xye(t,"iter")){if(!Bye(t.iter))throw new TypeError(bf("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=sW;a=uW(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=uW(r,e),t={iter:sW,state:a.state};return o=0,n={},vi(n,"next",g),vi(n,"return",d),t&&t.prng?(vi(n,"seed",null),vi(n,"seedLength",null),nW(n,"state",kye(null),Jye),vi(n,"stateLength",null),vi(n,"byteLength",null)):(qf(n,"seed",c),qf(n,"seedLength",p),nW(n,"state",l,v),qf(n,"stateLength",y),qf(n,"byteLength",f)),vi(n,"PRNG",a.PRNG),oW&&vi(n,oW,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function d(h){return u=!0,arguments.length?{value:h,done:!0}:{done:!0}}function m(){return gW(r,e,t)}function c(){return a.PRNG.seed}function p(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function f(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(h){a.PRNG.state=h}}vW.exports=gW});var lW=s(function(f5e,dW){"use strict";var Dye=fW();dW.exports=Dye});var mW=s(function(d5e,cW){"use strict";var _=require("@stdlib/utils/define-read-only-property"),R={};_(R,"arcsine",h1());_(R,"bernoulli",L1());_(R,"beta",A1());_(R,"betaprime",B1());_(R,"binomial",ex());_(R,"boxMuller",vx());_(R,"cauchy",qx());_(R,"chi",Px());_(R,"chisquare",Fx());_(R,"cosine",Xx());_(R,"discreteUniform",tG());_(R,"erlang",fG());_(R,"exponential",bG());_(R,"f",TG());_(R,"frechet",zG());_(R,"gamma",ZG());_(R,"geometric",aA());_(R,"gumbel",cA());_(R,"hypergeometric",OA());_(R,"improvedZiggurat",xA());_(R,"invgamma",UA());_(R,"kumaraswamy",KA());_(R,"laplace",oV());_(R,"levy",pV());_(R,"logistic",EV());_(R,"lognormal",AV());_(R,"minstd",CV());_(R,"minstdShuffle",KV());_(R,"mt19937",o2());_(R,"negativeBinomial",p2());_(R,"normal",E2());_(R,"pareto1",V2());_(R,"poisson",B2());_(R,"randi",eF());_(R,"randn",vF());_(R,"randu",qF());_(R,"rayleigh",PF());_(R,"t",FF());_(R,"triangular",XF());_(R,"uniform",iW());_(R,"weibull",lW());cW.exports=R});var pW=s(function(l5e,hW){"use strict";var Yye=require("@stdlib/math/base/special/floor");function Hye(r,e,i){var t,n,a,u;for(a=r.length,n=new Array(e),u=0;u0;a--)u=Qye(i()*(a+1)),t=r[a],r[a]=r[u],r[u]=t;return $ye.call(r,0,e)}bW.exports=Kye});var OW=s(function(h5e,SW){"use strict";var eqe=require("@stdlib/math/base/special/floor");function rqe(r,e,i,t){var n,a,u,o,g,d,m,c,p,y;for(u=t.slice(),d=r.length,n=[],a=[],p=0;p1){if(e=arguments[0],r=arguments[1],!(Tm(e)||jm(e)))throw new TypeError(Sf("invalid argument. `%s` argument must be array-like. Value: `%s`.","pool",e));n=Of(i,r)}if(n)throw n;return r&&r.seed?t=TW({seed:r.seed}):t=TW(),e===void 0?a=u:(_W(e)?e=e.split(""):e=jW(e),a=o),PW(a,"seed",t.seed),PW(a,"PRNG",t),t=t.normalized,a;function u(g,d){var m,c,p,y,f,l;if(!(Tm(g)||jm(g)))throw new TypeError(Sf("invalid argument. First argument must be array-like. Value: `%s`.",g));if(_W(g)&&(g=g.split("")),y={},arguments.length>1&&(l=Of(y,d),l))throw l;if(y.replace===void 0?m=i.replace:m=y.replace,y.probs!==void 0&&(p=y.probs),y.size?f=y.size:i.size?f=i.size:f=g.length,m===!1&&f>g.length)throw new RangeError(Sf("invalid option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `%s`.",f));return p?m?oqe(g,f,t,p):uqe(g,f,t,p):m?MW(g,f,t):(c=vqe.call(g),xW(c,f,t))}function o(g){var d,m,c,p,y,f;if(e.length===0)return null;if(c={},arguments.length&&(y=Of(c,g),y))throw y;if(c.mutate===void 0?m=i.mutate:m=c.mutate,c.replace===void 0?d=i.replace:d=c.replace,c.size?p=c.size:i.size?p=i.size:p=e.length,d===!1&&p>e.length)throw new RangeError(Sf("invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.",p));return d?MW(e,p,t):(f=xW(e,p,t),m&&(e=e.slice(p,e.length)),f)}}GW.exports=fqe});var VW=s(function(b5e,AW){"use strict";var dqe=Mm(),lqe=dqe();AW.exports=lqe});var IW=s(function(w5e,WW){"use strict";var cqe=require("@stdlib/utils/define-nonenumerable-read-only-property"),FW=VW(),mqe=Mm();cqe(FW,"factory",mqe);WW.exports=FW});var zW=s(function(S5e,hqe){hqe.exports={copy:"shallow"}});var UW=s(function(O5e,JW){"use strict";var pqe=require("@stdlib/assert/has-own-property"),yqe=require("@stdlib/assert/is-string").isPrimitive,qqe=require("@stdlib/assert/is-plain-object"),bqe=require("@stdlib/utils/index-of"),xm=require("@stdlib/string/format"),kW=["deep","shallow","none"];function wqe(r,e){if(!qqe(e))return new TypeError(xm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(pqe(e,"copy")){if(r.copy=e.copy,!yqe(r.copy))return new TypeError(xm("invalid option. `%s` option must be a string. Option: `%s`.","copy",r.copy));if(bqe(kW,r.copy)===-1)return new TypeError(xm('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"copy",kW.join('", "'),r.copy))}return null}JW.exports=wqe});var Gm=s(function(N5e,YW){"use strict";var CW=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sqe=require("@stdlib/assert/is-array-like"),Oqe=require("@stdlib/assert/is-typed-array-like"),Nqe=require("@stdlib/assert/is-string").isPrimitive,BW=require("@stdlib/utils/copy"),Lqe=require("@stdlib/math/base/special/floor"),XW=j().factory,Eqe=require("@stdlib/string/format"),Rqe=zW(),DW=UW();function Pqe(r){var e,i,t;if(e=BW(Rqe),arguments.length&&(t=DW(e,r),t))throw t;return r&&r.seed?i=XW({seed:r.seed}):i=XW(),CW(n,"seed",i.seed),CW(n,"PRNG",i),i=i.normalized,n;function n(a,u){var o,g,d,m,c,p,y,f,l,v;if(!(Sqe(a)||Oqe(a)))throw new TypeError(Eqe("invalid argument. First argument must be array-like. Value: `%s`.",a));if(arguments.length>1&&(m={},c=DW(m,u),c))throw c;for(d=m&&m.copy?m.copy:e.copy,o=Nqe(a),o&&(a=a.split(""),d="none"),g=0,d==="shallow"?g+=1:d==="deep"&&(g+=2),f=a.length,p=BW(a,g),l=f-1;l>0;l--)v=Lqe(i()*(l+1)),y=p[l],p[l]=p[v],p[v]=y;return o&&(p=a.join("")),p}}YW.exports=Pqe});var ZW=s(function(L5e,HW){"use strict";var _qe=Gm(),Tqe=_qe();HW.exports=Tqe});var KW=s(function(E5e,$W){"use strict";var jqe=require("@stdlib/utils/define-nonenumerable-read-only-property"),QW=ZW(),Mqe=Gm();jqe(QW,"factory",Mqe);$W.exports=QW});var eI=s(function(R5e,xqe){xqe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var iI=s(function(P5e,tI){"use strict";var Gqe=require("@stdlib/assert/is-plain-object"),Be=require("@stdlib/assert/has-own-property"),Aqe=require("@stdlib/assert/is-boolean").isPrimitive,Vqe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,rI=require("@stdlib/assert/is-string").isPrimitive,Fqe=require("@stdlib/assert/is-positive-integer").isPrimitive,Wqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,dn=require("@stdlib/string/format");function Iqe(r,e){return Gqe(e)?Be(e,"sep")&&(r.sep=e.sep,!rI(r.sep))?new TypeError(dn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Be(e,"objectMode")&&(r.objectMode=e.objectMode,!Aqe(r.objectMode))?new TypeError(dn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Be(e,"encoding")&&(r.encoding=e.encoding,!rI(r.encoding)&&r.encoding!==null)?new TypeError(dn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Be(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Vqe(r.highWaterMark))?new TypeError(dn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Be(e,"iter")&&(r.iter=e.iter,!Wqe(r.iter))?new TypeError(dn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Be(e,"siter")&&(r.siter=e.siter,!Fqe(r.siter))?new TypeError(dn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Be(e,"prng")&&(r.prng=e.prng),Be(e,"seed")&&(r.seed=e.seed),Be(e,"state")&&(r.state=e.state),Be(e,"copy")&&(r.copy=e.copy),null):new TypeError(dn("invalid argument. Options argument must be an object. Value: `%s`.",e))}tI.exports=Iqe});var aI=s(function(_5e,nI){"use strict";var zqe=require("debug"),kqe=zqe("random:streams:arcsine");nI.exports=kqe});var Lf=s(function(T5e,fI){"use strict";var vI=require("readable-stream").Readable,sI=require("@stdlib/assert/is-number").isPrimitive,uI=require("@stdlib/math/base/assert/is-nan"),Jqe=require("@stdlib/assert/is-error"),Uqe=require("@stdlib/object/assign"),Cqe=require("@stdlib/utils/inherit"),oI=require("@stdlib/utils/define-nonenumerable-property"),fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nf=require("@stdlib/utils/define-read-only-accessor"),Bqe=require("@stdlib/utils/define-read-write-accessor"),Xqe=Ki().factory,gI=require("@stdlib/buffer/from-string"),Dqe=require("@stdlib/utils/next-tick"),Am=require("@stdlib/string/format"),Yqe=eI(),Hqe=iI(),La=aI();function Zqe(){return this._prng.seed}function Qqe(){return this._prng.seedLength}function $qe(){return this._prng.stateLength}function Kqe(){return this._prng.byteLength}function ebe(){return this._prng.state}function rbe(r){this._prng.state=r}function tbe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return La("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),La("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=gI(e):e=gI(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function ibe(r){var e;if(this._destroyed)return La("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Dqe(i),this;function i(){r&&(La("Stream was destroyed due to an error. Error: %s.",Jqe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),La("Closing the stream..."),e.emit("close")}}function K(r,e,i){var t,n;if(!(this instanceof K))return arguments.length>2?new K(r,e,i):new K(r,e);if(!sI(r)||uI(r))throw new TypeError(Am("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!sI(e)||uI(e))throw new TypeError(Am("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(Am("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(t=Uqe({},Yqe),arguments.length>2&&(n=Hqe(t,i),n))throw n;return La("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),vI.call(this,t),oI(this,"_destroyed",!1),fi(this,"_objectMode",t.objectMode),fi(this,"_sep",t.sep),fi(this,"_iter",t.iter),fi(this,"_siter",t.siter),oI(this,"_i",0),fi(this,"_prng",Xqe(r,e,t)),fi(this,"PRNG",this._prng.PRNG),this}Cqe(K,vI);Nf(K.prototype,"seed",Zqe);Nf(K.prototype,"seedLength",Qqe);Bqe(K.prototype,"state",ebe,rbe);Nf(K.prototype,"stateLength",$qe);Nf(K.prototype,"byteLength",Kqe);fi(K.prototype,"_read",tbe);fi(K.prototype,"destroy",ibe);fI.exports=K});var lI=s(function(j5e,dI){"use strict";var nbe=require("@stdlib/assert/is-plain-object"),abe=require("@stdlib/string/format"),sbe=require("@stdlib/object/assign"),ube=Lf();function obe(r,e,i){var t;if(arguments.length>2){if(t=i,!nbe(t))throw new TypeError(abe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=sbe({},i)}else t={};return t.objectMode=!0,new ube(r,e,t)}dI.exports=obe});var qI=s(function(M5e,yI){"use strict";var cI=require("@stdlib/assert/is-plain-object"),mI=require("@stdlib/object/assign"),hI=require("@stdlib/string/format"),pI=Lf();function gbe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!cI(r))throw new TypeError(hI("invalid argument. Options argument must be an object. Value: `%s`.",r));n=mI({},r)}else if(t>2){if(!cI(i))throw new TypeError(hI("invalid argument. Options argument must be an object. Value: `%s`.",i));n=mI({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new pI(g,d,n)}function o(){return new pI(r,e,n)}}yI.exports=gbe});var SI=s(function(x5e,wI){"use strict";var bI=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vm=Lf(),vbe=lI(),fbe=qI();bI(Vm,"objectMode",vbe);bI(Vm,"factory",fbe);wI.exports=Vm});var OI=s(function(G5e,dbe){dbe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var EI=s(function(A5e,LI){"use strict";var lbe=require("@stdlib/assert/is-plain-object"),Xe=require("@stdlib/assert/has-own-property"),cbe=require("@stdlib/assert/is-boolean").isPrimitive,mbe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,NI=require("@stdlib/assert/is-string").isPrimitive,hbe=require("@stdlib/assert/is-positive-integer").isPrimitive,pbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ln=require("@stdlib/string/format");function ybe(r,e){return lbe(e)?Xe(e,"sep")&&(r.sep=e.sep,!NI(r.sep))?new TypeError(ln("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Xe(e,"objectMode")&&(r.objectMode=e.objectMode,!cbe(r.objectMode))?new TypeError(ln("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Xe(e,"encoding")&&(r.encoding=e.encoding,!NI(r.encoding)&&r.encoding!==null)?new TypeError(ln("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Xe(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!mbe(r.highWaterMark))?new TypeError(ln("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Xe(e,"iter")&&(r.iter=e.iter,!pbe(r.iter))?new TypeError(ln("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Xe(e,"siter")&&(r.siter=e.siter,!hbe(r.siter))?new TypeError(ln("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Xe(e,"prng")&&(r.prng=e.prng),Xe(e,"seed")&&(r.seed=e.seed),Xe(e,"state")&&(r.state=e.state),Xe(e,"copy")&&(r.copy=e.copy),null):new TypeError(ln("invalid argument. Options argument must be an object. Value: `%s`.",e))}LI.exports=ybe});var PI=s(function(V5e,RI){"use strict";var qbe=require("debug"),bbe=qbe("random:streams:bernoulli");RI.exports=bbe});var Rf=s(function(F5e,MI){"use strict";var jI=require("readable-stream").Readable,wbe=require("@stdlib/assert/is-probability").isPrimitive,Sbe=require("@stdlib/assert/is-error"),Obe=require("@stdlib/object/assign"),Nbe=require("@stdlib/utils/inherit"),_I=require("@stdlib/utils/define-nonenumerable-property"),di=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ef=require("@stdlib/utils/define-read-only-accessor"),Lbe=require("@stdlib/utils/define-read-write-accessor"),Ebe=zs().factory,TI=require("@stdlib/buffer/from-string"),Rbe=require("@stdlib/utils/next-tick"),Pbe=require("@stdlib/string/format"),_be=OI(),Tbe=EI(),Ea=PI();function jbe(){return this._prng.seed}function Mbe(){return this._prng.seedLength}function xbe(){return this._prng.stateLength}function Gbe(){return this._prng.byteLength}function Abe(){return this._prng.state}function Vbe(r){this._prng.state=r}function Fbe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ea("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ea("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=TI(e):e=TI(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Wbe(r){var e;if(this._destroyed)return Ea("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Rbe(i),this;function i(){r&&(Ea("Stream was destroyed due to an error. Error: %s.",Sbe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ea("Closing the stream..."),e.emit("close")}}function ee(r,e){var i,t;if(!(this instanceof ee))return arguments.length>1?new ee(r,e):new ee(r);if(!wbe(r))throw new TypeError(Pbe("invalid argument. First argument must be a probability. Value: `%s`.",r));if(i=Obe({},_be),arguments.length>1&&(t=Tbe(i,e),t))throw t;return Ea("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),jI.call(this,i),_I(this,"_destroyed",!1),di(this,"_objectMode",i.objectMode),di(this,"_sep",i.sep),di(this,"_iter",i.iter),di(this,"_siter",i.siter),_I(this,"_i",0),di(this,"_prng",Ebe(r,i)),di(this,"PRNG",this._prng.PRNG),this}Nbe(ee,jI);Ef(ee.prototype,"seed",jbe);Ef(ee.prototype,"seedLength",Mbe);Lbe(ee.prototype,"state",Abe,Vbe);Ef(ee.prototype,"stateLength",xbe);Ef(ee.prototype,"byteLength",Gbe);di(ee.prototype,"_read",Fbe);di(ee.prototype,"destroy",Wbe);MI.exports=ee});var GI=s(function(W5e,xI){"use strict";var Ibe=require("@stdlib/assert/is-plain-object"),zbe=require("@stdlib/string/format"),kbe=require("@stdlib/object/assign"),Jbe=Rf();function Ube(r,e){var i;if(arguments.length>1){if(i=e,!Ibe(i))throw new TypeError(zbe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=kbe({},e)}else i={};return i.objectMode=!0,new Jbe(r,i)}xI.exports=Ube});var zI=s(function(I5e,II){"use strict";var AI=require("@stdlib/assert/is-plain-object"),Cbe=require("@stdlib/assert/is-probability").isPrimitive,VI=require("@stdlib/string/format"),FI=require("@stdlib/object/assign"),WI=Rf();function Bbe(r,e){var i,t,n;if(i=arguments.length,i>1){if(!AI(e))throw new TypeError(VI("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=FI({},e)}else if(i===1)if(Cbe(r))n=u,t={};else{if(!AI(r))throw new TypeError(VI("invalid argument. Options argument must be an object. Value: `%s`.",r));t=FI({},r),n=a}else t={},n=a;return n;function a(o){return new WI(o,t)}function u(){return new WI(r,t)}}II.exports=Bbe});var UI=s(function(z5e,JI){"use strict";var kI=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fm=Rf(),Xbe=GI(),Dbe=zI();kI(Fm,"objectMode",Xbe);kI(Fm,"factory",Dbe);JI.exports=Fm});var CI=s(function(k5e,Ybe){Ybe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var DI=s(function(J5e,XI){"use strict";var Hbe=require("@stdlib/assert/is-plain-object"),De=require("@stdlib/assert/has-own-property"),Zbe=require("@stdlib/assert/is-boolean").isPrimitive,Qbe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,BI=require("@stdlib/assert/is-string").isPrimitive,$be=require("@stdlib/assert/is-positive-integer").isPrimitive,Kbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,cn=require("@stdlib/string/format");function ewe(r,e){return Hbe(e)?De(e,"sep")&&(r.sep=e.sep,!BI(r.sep))?new TypeError(cn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):De(e,"objectMode")&&(r.objectMode=e.objectMode,!Zbe(r.objectMode))?new TypeError(cn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):De(e,"encoding")&&(r.encoding=e.encoding,!BI(r.encoding)&&r.encoding!==null)?new TypeError(cn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):De(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Qbe(r.highWaterMark))?new TypeError(cn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):De(e,"iter")&&(r.iter=e.iter,!Kbe(r.iter))?new TypeError(cn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):De(e,"siter")&&(r.siter=e.siter,!$be(r.siter))?new TypeError(cn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(De(e,"prng")&&(r.prng=e.prng),De(e,"seed")&&(r.seed=e.seed),De(e,"state")&&(r.state=e.state),De(e,"copy")&&(r.copy=e.copy),null):new TypeError(cn("invalid argument. Options argument must be an object. Value: `%s`.",e))}XI.exports=ewe});var HI=s(function(U5e,YI){"use strict";var rwe=require("debug"),twe=rwe("random:streams:beta");YI.exports=twe});var _f=s(function(C5e,rz){"use strict";var ez=require("readable-stream").Readable,ZI=require("@stdlib/assert/is-positive-number").isPrimitive,iwe=require("@stdlib/assert/is-error"),nwe=require("@stdlib/object/assign"),awe=require("@stdlib/utils/inherit"),QI=require("@stdlib/utils/define-nonenumerable-property"),li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pf=require("@stdlib/utils/define-read-only-accessor"),swe=require("@stdlib/utils/define-read-write-accessor"),uwe=rn().factory,$I=require("@stdlib/buffer/from-string"),owe=require("@stdlib/utils/next-tick"),KI=require("@stdlib/string/format"),gwe=CI(),vwe=DI(),Ra=HI();function fwe(){return this._prng.seed}function dwe(){return this._prng.seedLength}function lwe(){return this._prng.stateLength}function cwe(){return this._prng.byteLength}function mwe(){return this._prng.state}function hwe(r){this._prng.state=r}function pwe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ra("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ra("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=$I(e):e=$I(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function ywe(r){var e;if(this._destroyed)return Ra("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,owe(i),this;function i(){r&&(Ra("Stream was destroyed due to an error. Error: %s.",iwe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ra("Closing the stream..."),e.emit("close")}}function re(r,e,i){var t,n;if(!(this instanceof re))return arguments.length>2?new re(r,e,i):new re(r,e);if(!ZI(r))throw new TypeError(KI("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!ZI(e))throw new TypeError(KI("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=nwe({},gwe),arguments.length>2&&(n=vwe(t,i),n))throw n;return Ra("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),ez.call(this,t),QI(this,"_destroyed",!1),li(this,"_objectMode",t.objectMode),li(this,"_sep",t.sep),li(this,"_iter",t.iter),li(this,"_siter",t.siter),QI(this,"_i",0),li(this,"_prng",uwe(r,e,t)),li(this,"PRNG",this._prng.PRNG),this}awe(re,ez);Pf(re.prototype,"seed",fwe);Pf(re.prototype,"seedLength",dwe);swe(re.prototype,"state",mwe,hwe);Pf(re.prototype,"stateLength",lwe);Pf(re.prototype,"byteLength",cwe);li(re.prototype,"_read",pwe);li(re.prototype,"destroy",ywe);rz.exports=re});var iz=s(function(B5e,tz){"use strict";var qwe=require("@stdlib/assert/is-plain-object"),bwe=require("@stdlib/string/format"),wwe=require("@stdlib/object/assign"),Swe=_f();function Owe(r,e,i){var t;if(arguments.length>2){if(t=i,!qwe(t))throw new TypeError(bwe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=wwe({},i)}else t={};return t.objectMode=!0,new Swe(r,e,t)}tz.exports=Owe});var gz=s(function(X5e,oz){"use strict";var nz=require("@stdlib/assert/is-plain-object"),az=require("@stdlib/object/assign"),sz=require("@stdlib/string/format"),uz=_f();function Nwe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!nz(r))throw new TypeError(sz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=az({},r)}else if(t>2){if(!nz(i))throw new TypeError(sz("invalid argument. Options argument must be an object. Value: `%s`.",i));n=az({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new uz(g,d,n)}function o(){return new uz(r,e,n)}}oz.exports=Nwe});var dz=s(function(D5e,fz){"use strict";var vz=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wm=_f(),Lwe=iz(),Ewe=gz();vz(Wm,"objectMode",Lwe);vz(Wm,"factory",Ewe);fz.exports=Wm});var lz=s(function(Y5e,Rwe){Rwe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var hz=s(function(H5e,mz){"use strict";var Pwe=require("@stdlib/assert/is-plain-object"),Ye=require("@stdlib/assert/has-own-property"),_we=require("@stdlib/assert/is-boolean").isPrimitive,Twe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,cz=require("@stdlib/assert/is-string").isPrimitive,jwe=require("@stdlib/assert/is-positive-integer").isPrimitive,Mwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,mn=require("@stdlib/string/format");function xwe(r,e){return Pwe(e)?Ye(e,"sep")&&(r.sep=e.sep,!cz(r.sep))?new TypeError(mn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ye(e,"objectMode")&&(r.objectMode=e.objectMode,!_we(r.objectMode))?new TypeError(mn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ye(e,"encoding")&&(r.encoding=e.encoding,!cz(r.encoding)&&r.encoding!==null)?new TypeError(mn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ye(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Twe(r.highWaterMark))?new TypeError(mn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ye(e,"iter")&&(r.iter=e.iter,!Mwe(r.iter))?new TypeError(mn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ye(e,"siter")&&(r.siter=e.siter,!jwe(r.siter))?new TypeError(mn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ye(e,"prng")&&(r.prng=e.prng),Ye(e,"seed")&&(r.seed=e.seed),Ye(e,"state")&&(r.state=e.state),Ye(e,"copy")&&(r.copy=e.copy),null):new TypeError(mn("invalid argument. Options argument must be an object. Value: `%s`.",e))}mz.exports=xwe});var yz=s(function(Z5e,pz){"use strict";var Gwe=require("debug"),Awe=Gwe("random:streams:betaprime");pz.exports=Awe});var jf=s(function(Q5e,Nz){"use strict";var Oz=require("readable-stream").Readable,qz=require("@stdlib/assert/is-positive-number").isPrimitive,Vwe=require("@stdlib/assert/is-error"),Fwe=require("@stdlib/object/assign"),Wwe=require("@stdlib/utils/inherit"),bz=require("@stdlib/utils/define-nonenumerable-property"),ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tf=require("@stdlib/utils/define-read-only-accessor"),Iwe=require("@stdlib/utils/define-read-write-accessor"),zwe=tn().factory,wz=require("@stdlib/buffer/from-string"),kwe=require("@stdlib/utils/next-tick"),Sz=require("@stdlib/string/format"),Jwe=lz(),Uwe=hz(),Pa=yz();function Cwe(){return this._prng.seed}function Bwe(){return this._prng.seedLength}function Xwe(){return this._prng.stateLength}function Dwe(){return this._prng.byteLength}function Ywe(){return this._prng.state}function Hwe(r){this._prng.state=r}function Zwe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Pa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Pa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=wz(e):e=wz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Qwe(r){var e;if(this._destroyed)return Pa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,kwe(i),this;function i(){r&&(Pa("Stream was destroyed due to an error. Error: %s.",Vwe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Pa("Closing the stream..."),e.emit("close")}}function te(r,e,i){var t,n;if(!(this instanceof te))return arguments.length>2?new te(r,e,i):new te(r,e);if(!qz(r))throw new TypeError(Sz("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!qz(e))throw new TypeError(Sz("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=Fwe({},Jwe),arguments.length>2&&(n=Uwe(t,i),n))throw n;return Pa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Oz.call(this,t),bz(this,"_destroyed",!1),ci(this,"_objectMode",t.objectMode),ci(this,"_sep",t.sep),ci(this,"_iter",t.iter),ci(this,"_siter",t.siter),bz(this,"_i",0),ci(this,"_prng",zwe(r,e,t)),ci(this,"PRNG",this._prng.PRNG),this}Wwe(te,Oz);Tf(te.prototype,"seed",Cwe);Tf(te.prototype,"seedLength",Bwe);Iwe(te.prototype,"state",Ywe,Hwe);Tf(te.prototype,"stateLength",Xwe);Tf(te.prototype,"byteLength",Dwe);ci(te.prototype,"_read",Zwe);ci(te.prototype,"destroy",Qwe);Nz.exports=te});var Ez=s(function($5e,Lz){"use strict";var $we=require("@stdlib/assert/is-plain-object"),Kwe=require("@stdlib/string/format"),eSe=require("@stdlib/object/assign"),rSe=jf();function tSe(r,e,i){var t;if(arguments.length>2){if(t=i,!$we(t))throw new TypeError(Kwe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=eSe({},i)}else t={};return t.objectMode=!0,new rSe(r,e,t)}Lz.exports=tSe});var Mz=s(function(K5e,jz){"use strict";var Rz=require("@stdlib/assert/is-plain-object"),Pz=require("@stdlib/object/assign"),_z=require("@stdlib/string/format"),Tz=jf();function iSe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!Rz(r))throw new TypeError(_z("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Pz({},r)}else if(t>2){if(!Rz(i))throw new TypeError(_z("invalid argument. Options argument must be an object. Value: `%s`.",i));n=Pz({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new Tz(g,d,n)}function o(){return new Tz(r,e,n)}}jz.exports=iSe});var Az=s(function(e4e,Gz){"use strict";var xz=require("@stdlib/utils/define-nonenumerable-read-only-property"),Im=jf(),nSe=Ez(),aSe=Mz();xz(Im,"objectMode",nSe);xz(Im,"factory",aSe);Gz.exports=Im});var Vz=s(function(r4e,sSe){sSe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Iz=s(function(t4e,Wz){"use strict";var uSe=require("@stdlib/assert/is-plain-object"),He=require("@stdlib/assert/has-own-property"),oSe=require("@stdlib/assert/is-boolean").isPrimitive,gSe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Fz=require("@stdlib/assert/is-string").isPrimitive,vSe=require("@stdlib/assert/is-positive-integer").isPrimitive,fSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,hn=require("@stdlib/string/format");function dSe(r,e){return uSe(e)?He(e,"sep")&&(r.sep=e.sep,!Fz(r.sep))?new TypeError(hn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):He(e,"objectMode")&&(r.objectMode=e.objectMode,!oSe(r.objectMode))?new TypeError(hn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):He(e,"encoding")&&(r.encoding=e.encoding,!Fz(r.encoding)&&r.encoding!==null)?new TypeError(hn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):He(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!gSe(r.highWaterMark))?new TypeError(hn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):He(e,"iter")&&(r.iter=e.iter,!fSe(r.iter))?new TypeError(hn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):He(e,"siter")&&(r.siter=e.siter,!vSe(r.siter))?new TypeError(hn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(He(e,"prng")&&(r.prng=e.prng),He(e,"seed")&&(r.seed=e.seed),He(e,"state")&&(r.state=e.state),He(e,"copy")&&(r.copy=e.copy),null):new TypeError(hn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Wz.exports=dSe});var kz=s(function(i4e,zz){"use strict";var lSe=require("debug"),cSe=lSe("random:streams:binomial");zz.exports=cSe});var xf=s(function(n4e,Xz){"use strict";var Bz=require("readable-stream").Readable,mSe=require("@stdlib/assert/is-positive-integer").isPrimitive,hSe=require("@stdlib/assert/is-probability").isPrimitive,pSe=require("@stdlib/assert/is-error"),ySe=require("@stdlib/object/assign"),qSe=require("@stdlib/utils/inherit"),Jz=require("@stdlib/utils/define-nonenumerable-property"),mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mf=require("@stdlib/utils/define-read-only-accessor"),bSe=require("@stdlib/utils/define-read-write-accessor"),wSe=ks().factory,Uz=require("@stdlib/buffer/from-string"),SSe=require("@stdlib/utils/next-tick"),Cz=require("@stdlib/string/format"),OSe=Vz(),NSe=Iz(),_a=kz();function LSe(){return this._prng.seed}function ESe(){return this._prng.seedLength}function RSe(){return this._prng.stateLength}function PSe(){return this._prng.byteLength}function _Se(){return this._prng.state}function TSe(r){this._prng.state=r}function jSe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return _a("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),_a("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Uz(e):e=Uz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function MSe(r){var e;if(this._destroyed)return _a("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,SSe(i),this;function i(){r&&(_a("Stream was destroyed due to an error. Error: %s.",pSe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),_a("Closing the stream..."),e.emit("close")}}function ie(r,e,i){var t,n;if(!(this instanceof ie))return arguments.length>2?new ie(r,e,i):new ie(r,e);if(!mSe(r))throw new TypeError(Cz("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!hSe(e))throw new TypeError(Cz("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(t=ySe({},OSe),arguments.length>2&&(n=NSe(t,i),n))throw n;return _a("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Bz.call(this,t),Jz(this,"_destroyed",!1),mi(this,"_objectMode",t.objectMode),mi(this,"_sep",t.sep),mi(this,"_iter",t.iter),mi(this,"_siter",t.siter),Jz(this,"_i",0),mi(this,"_prng",wSe(r,e,t)),mi(this,"PRNG",this._prng.PRNG),this}qSe(ie,Bz);Mf(ie.prototype,"seed",LSe);Mf(ie.prototype,"seedLength",ESe);bSe(ie.prototype,"state",_Se,TSe);Mf(ie.prototype,"stateLength",RSe);Mf(ie.prototype,"byteLength",PSe);mi(ie.prototype,"_read",jSe);mi(ie.prototype,"destroy",MSe);Xz.exports=ie});var Yz=s(function(a4e,Dz){"use strict";var xSe=require("@stdlib/assert/is-plain-object"),GSe=require("@stdlib/object/assign"),ASe=require("@stdlib/string/format"),VSe=xf();function FSe(r,e,i){var t;if(arguments.length>2){if(t=i,!xSe(t))throw new TypeError(ASe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=GSe({},i)}else t={};return t.objectMode=!0,new VSe(r,e,t)}Dz.exports=FSe});var ek=s(function(s4e,Kz){"use strict";var Hz=require("@stdlib/assert/is-plain-object"),Zz=require("@stdlib/object/assign"),Qz=require("@stdlib/string/format"),$z=xf();function WSe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!Hz(r))throw new TypeError(Qz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Zz({},r)}else if(t>2){if(!Hz(i))throw new TypeError(Qz("invalid argument. Options argument must be an object. Value: `%s`.",i));n=Zz({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new $z(g,d,n)}function o(){return new $z(r,e,n)}}Kz.exports=WSe});var ik=s(function(u4e,tk){"use strict";var rk=require("@stdlib/utils/define-nonenumerable-read-only-property"),zm=xf(),ISe=Yz(),zSe=ek();rk(zm,"objectMode",ISe);rk(zm,"factory",zSe);tk.exports=zm});var nk=s(function(o4e,kSe){kSe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var uk=s(function(g4e,sk){"use strict";var JSe=require("@stdlib/assert/is-plain-object"),Ze=require("@stdlib/assert/has-own-property"),USe=require("@stdlib/assert/is-boolean").isPrimitive,CSe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,ak=require("@stdlib/assert/is-string").isPrimitive,BSe=require("@stdlib/assert/is-positive-integer").isPrimitive,XSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,pn=require("@stdlib/string/format");function DSe(r,e){return JSe(e)?Ze(e,"sep")&&(r.sep=e.sep,!ak(r.sep))?new TypeError(pn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ze(e,"objectMode")&&(r.objectMode=e.objectMode,!USe(r.objectMode))?new TypeError(pn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ze(e,"encoding")&&(r.encoding=e.encoding,!ak(r.encoding)&&r.encoding!==null)?new TypeError(pn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ze(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!CSe(r.highWaterMark))?new TypeError(pn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ze(e,"iter")&&(r.iter=e.iter,!XSe(r.iter))?new TypeError(pn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ze(e,"siter")&&(r.siter=e.siter,!BSe(r.siter))?new TypeError(pn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ze(e,"prng")&&(r.prng=e.prng),Ze(e,"seed")&&(r.seed=e.seed),Ze(e,"state")&&(r.state=e.state),Ze(e,"copy")&&(r.copy=e.copy),null):new TypeError(pn("invalid argument. Options argument must be an object. Value: `%s`.",e))}sk.exports=DSe});var gk=s(function(v4e,ok){"use strict";var YSe=require("debug"),HSe=YSe("random:streams:box-muller");ok.exports=HSe});var Af=s(function(f4e,lk){"use strict";var dk=require("readable-stream").Readable,ZSe=require("@stdlib/assert/is-error"),QSe=require("@stdlib/object/assign"),$Se=require("@stdlib/utils/inherit"),vk=require("@stdlib/utils/define-nonenumerable-property"),hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gf=require("@stdlib/utils/define-read-only-accessor"),KSe=require("@stdlib/utils/define-read-write-accessor"),eOe=da().factory,fk=require("@stdlib/buffer/from-string"),rOe=require("@stdlib/utils/next-tick"),tOe=nk(),iOe=uk(),Ta=gk();function nOe(){return this._prng.seed}function aOe(){return this._prng.seedLength}function sOe(){return this._prng.stateLength}function uOe(){return this._prng.byteLength}function oOe(){return this._prng.state}function gOe(r){this._prng.state=r}function vOe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ta("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ta("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=fk(e):e=fk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function fOe(r){var e;if(this._destroyed)return Ta("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rOe(i),this;function i(){r&&(Ta("Stream was destroyed due to an error. Error: %s.",ZSe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ta("Closing the stream..."),e.emit("close")}}function ne(r){var e,i;if(!(this instanceof ne))return arguments.length>0?new ne(r):new ne;if(e=QSe({},tOe),arguments.length>0&&(i=iOe(e,r),i))throw i;return Ta("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),dk.call(this,e),vk(this,"_destroyed",!1),hi(this,"_objectMode",e.objectMode),hi(this,"_sep",e.sep),hi(this,"_iter",e.iter),hi(this,"_siter",e.siter),vk(this,"_i",0),hi(this,"_prng",eOe(e)),hi(this,"PRNG",this._prng.PRNG),this}$Se(ne,dk);Gf(ne.prototype,"seed",nOe);Gf(ne.prototype,"seedLength",aOe);KSe(ne.prototype,"state",oOe,gOe);Gf(ne.prototype,"stateLength",sOe);Gf(ne.prototype,"byteLength",uOe);hi(ne.prototype,"_read",vOe);hi(ne.prototype,"destroy",fOe);lk.exports=ne});var mk=s(function(d4e,ck){"use strict";var dOe=require("@stdlib/assert/is-plain-object"),lOe=require("@stdlib/object/assign"),cOe=require("@stdlib/string/format"),mOe=Af();function hOe(r){var e;if(arguments.length>0){if(e=r,!dOe(e))throw new TypeError(cOe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=lOe({},r)}else e={};return e.objectMode=!0,new mOe(e)}ck.exports=hOe});var pk=s(function(l4e,hk){"use strict";var pOe=require("@stdlib/assert/is-plain-object"),yOe=require("@stdlib/object/assign"),qOe=require("@stdlib/string/format"),bOe=Af();function wOe(r){var e;if(arguments.length>0){if(!pOe(r))throw new TypeError(qOe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=yOe({},r)}else e={};return i;function i(){return new bOe(e)}}hk.exports=wOe});var bk=s(function(c4e,qk){"use strict";var yk=require("@stdlib/utils/define-nonenumerable-read-only-property"),km=Af(),SOe=mk(),OOe=pk();yk(km,"objectMode",SOe);yk(km,"factory",OOe);qk.exports=km});var wk=s(function(m4e,NOe){NOe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Nk=s(function(h4e,Ok){"use strict";var LOe=require("@stdlib/assert/is-plain-object"),Qe=require("@stdlib/assert/has-own-property"),EOe=require("@stdlib/assert/is-boolean").isPrimitive,ROe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Sk=require("@stdlib/assert/is-string").isPrimitive,POe=require("@stdlib/assert/is-positive-integer").isPrimitive,_Oe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,yn=require("@stdlib/string/format");function TOe(r,e){return LOe(e)?Qe(e,"sep")&&(r.sep=e.sep,!Sk(r.sep))?new TypeError(yn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Qe(e,"objectMode")&&(r.objectMode=e.objectMode,!EOe(r.objectMode))?new TypeError(yn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Qe(e,"encoding")&&(r.encoding=e.encoding,!Sk(r.encoding)&&r.encoding!==null)?new TypeError(yn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Qe(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!ROe(r.highWaterMark))?new TypeError(yn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Qe(e,"iter")&&(r.iter=e.iter,!_Oe(r.iter))?new TypeError(yn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Qe(e,"siter")&&(r.siter=e.siter,!POe(r.siter))?new TypeError(yn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Qe(e,"prng")&&(r.prng=e.prng),Qe(e,"seed")&&(r.seed=e.seed),Qe(e,"state")&&(r.state=e.state),Qe(e,"copy")&&(r.copy=e.copy),null):new TypeError(yn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Ok.exports=TOe});var Ek=s(function(p4e,Lk){"use strict";var jOe=require("debug"),MOe=jOe("random:streams:cauchy");Lk.exports=MOe});var Ff=s(function(y4e,jk){"use strict";var Tk=require("readable-stream").Readable,xOe=require("@stdlib/assert/is-positive-number").isPrimitive,GOe=require("@stdlib/assert/is-number").isPrimitive,AOe=require("@stdlib/math/base/assert/is-nan"),VOe=require("@stdlib/assert/is-error"),FOe=require("@stdlib/object/assign"),WOe=require("@stdlib/utils/inherit"),Rk=require("@stdlib/utils/define-nonenumerable-property"),pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vf=require("@stdlib/utils/define-read-only-accessor"),IOe=require("@stdlib/utils/define-read-write-accessor"),zOe=Cs().factory,Pk=require("@stdlib/buffer/from-string"),kOe=require("@stdlib/utils/next-tick"),_k=require("@stdlib/string/format"),JOe=wk(),UOe=Nk(),ja=Ek();function COe(){return this._prng.seed}function BOe(){return this._prng.seedLength}function XOe(){return this._prng.stateLength}function DOe(){return this._prng.byteLength}function YOe(){return this._prng.state}function HOe(r){this._prng.state=r}function ZOe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ja("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ja("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Pk(e):e=Pk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function QOe(r){var e;if(this._destroyed)return ja("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,kOe(i),this;function i(){r&&(ja("Stream was destroyed due to an error. Error: %s.",VOe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ja("Closing the stream..."),e.emit("close")}}function ae(r,e,i){var t,n;if(!(this instanceof ae))return arguments.length>2?new ae(r,e,i):new ae(r,e);if(!GOe(r)||AOe(r))throw new TypeError(_k("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!xOe(e))throw new TypeError(_k("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=FOe({},JOe),arguments.length>2&&(n=UOe(t,i),n))throw n;return ja("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Tk.call(this,t),Rk(this,"_destroyed",!1),pi(this,"_objectMode",t.objectMode),pi(this,"_sep",t.sep),pi(this,"_iter",t.iter),pi(this,"_siter",t.siter),Rk(this,"_i",0),pi(this,"_prng",zOe(r,e,t)),pi(this,"PRNG",this._prng.PRNG),this}WOe(ae,Tk);Vf(ae.prototype,"seed",COe);Vf(ae.prototype,"seedLength",BOe);IOe(ae.prototype,"state",YOe,HOe);Vf(ae.prototype,"stateLength",XOe);Vf(ae.prototype,"byteLength",DOe);pi(ae.prototype,"_read",ZOe);pi(ae.prototype,"destroy",QOe);jk.exports=ae});var xk=s(function(q4e,Mk){"use strict";var $Oe=require("@stdlib/assert/is-plain-object"),KOe=require("@stdlib/object/assign"),eNe=require("@stdlib/string/format"),rNe=Ff();function tNe(r,e,i){var t;if(arguments.length>2){if(t=i,!$Oe(t))throw new TypeError(eNe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=KOe({},i)}else t={};return t.objectMode=!0,new rNe(r,e,t)}Mk.exports=tNe});var Ik=s(function(b4e,Wk){"use strict";var Gk=require("@stdlib/assert/is-plain-object"),Ak=require("@stdlib/object/assign"),Vk=require("@stdlib/string/format"),Fk=Ff();function iNe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!Gk(r))throw new TypeError(Vk("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Ak({},r)}else if(t>2){if(!Gk(i))throw new TypeError(Vk("invalid argument. Options argument must be an object. Value: `%s`.",i));n=Ak({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new Fk(g,d,n)}function o(){return new Fk(r,e,n)}}Wk.exports=iNe});var Jk=s(function(w4e,kk){"use strict";var zk=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jm=Ff(),nNe=xk(),aNe=Ik();zk(Jm,"objectMode",nNe);zk(Jm,"factory",aNe);kk.exports=Jm});var Uk=s(function(S4e,sNe){sNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Xk=s(function(O4e,Bk){"use strict";var uNe=require("@stdlib/assert/is-plain-object"),$e=require("@stdlib/assert/has-own-property"),oNe=require("@stdlib/assert/is-boolean").isPrimitive,gNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Ck=require("@stdlib/assert/is-string").isPrimitive,vNe=require("@stdlib/assert/is-positive-integer").isPrimitive,fNe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qn=require("@stdlib/string/format");function dNe(r,e){return uNe(e)?$e(e,"sep")&&(r.sep=e.sep,!Ck(r.sep))?new TypeError(qn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):$e(e,"objectMode")&&(r.objectMode=e.objectMode,!oNe(r.objectMode))?new TypeError(qn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):$e(e,"encoding")&&(r.encoding=e.encoding,!Ck(r.encoding)&&r.encoding!==null)?new TypeError(qn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):$e(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!gNe(r.highWaterMark))?new TypeError(qn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):$e(e,"iter")&&(r.iter=e.iter,!fNe(r.iter))?new TypeError(qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):$e(e,"siter")&&(r.siter=e.siter,!vNe(r.siter))?new TypeError(qn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):($e(e,"prng")&&(r.prng=e.prng),$e(e,"seed")&&(r.seed=e.seed),$e(e,"state")&&(r.state=e.state),$e(e,"copy")&&(r.copy=e.copy),null):new TypeError(qn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Bk.exports=dNe});var Yk=s(function(N4e,Dk){"use strict";var lNe=require("debug"),cNe=lNe("random:streams:chi");Dk.exports=cNe});var If=s(function(L4e,$k){"use strict";var Qk=require("readable-stream").Readable,mNe=require("@stdlib/assert/is-positive-number").isPrimitive,hNe=require("@stdlib/assert/is-error"),pNe=require("@stdlib/object/assign"),yNe=require("@stdlib/utils/inherit"),Hk=require("@stdlib/utils/define-nonenumerable-property"),yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wf=require("@stdlib/utils/define-read-only-accessor"),qNe=require("@stdlib/utils/define-read-write-accessor"),bNe=Bs().factory,Zk=require("@stdlib/buffer/from-string"),wNe=require("@stdlib/utils/next-tick"),SNe=require("@stdlib/string/format"),ONe=Uk(),NNe=Xk(),Ma=Yk();function LNe(){return this._prng.seed}function ENe(){return this._prng.seedLength}function RNe(){return this._prng.stateLength}function PNe(){return this._prng.byteLength}function _Ne(){return this._prng.state}function TNe(r){this._prng.state=r}function jNe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ma("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ma("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Zk(e):e=Zk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function MNe(r){var e;if(this._destroyed)return Ma("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,wNe(i),this;function i(){r&&(Ma("Stream was destroyed due to an error. Error: %s.",hNe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ma("Closing the stream..."),e.emit("close")}}function se(r,e){var i,t;if(!(this instanceof se))return arguments.length>1?new se(r,e):new se(r);if(!mNe(r))throw new TypeError(SNe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=pNe({},ONe),arguments.length>1&&(t=NNe(i,e),t))throw t;return Ma("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Qk.call(this,i),Hk(this,"_destroyed",!1),yi(this,"_objectMode",i.objectMode),yi(this,"_sep",i.sep),yi(this,"_iter",i.iter),yi(this,"_siter",i.siter),Hk(this,"_i",0),yi(this,"_prng",bNe(r,i)),yi(this,"PRNG",this._prng.PRNG),this}yNe(se,Qk);Wf(se.prototype,"seed",LNe);Wf(se.prototype,"seedLength",ENe);qNe(se.prototype,"state",_Ne,TNe);Wf(se.prototype,"stateLength",RNe);Wf(se.prototype,"byteLength",PNe);yi(se.prototype,"_read",jNe);yi(se.prototype,"destroy",MNe);$k.exports=se});var e3=s(function(E4e,Kk){"use strict";var xNe=require("@stdlib/assert/is-plain-object"),GNe=require("@stdlib/object/assign"),ANe=require("@stdlib/string/format"),VNe=If();function FNe(r,e){var i;if(arguments.length>1){if(i=e,!xNe(i))throw new TypeError(ANe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=GNe({},e)}else i={};return i.objectMode=!0,new VNe(r,i)}Kk.exports=FNe});var s3=s(function(R4e,a3){"use strict";var r3=require("@stdlib/assert/is-plain-object"),WNe=require("@stdlib/assert/is-positive-number").isPrimitive,t3=require("@stdlib/object/assign"),i3=require("@stdlib/string/format"),n3=If();function INe(r,e){var i,t,n;if(i=arguments.length,i>1){if(!r3(e))throw new TypeError(i3("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=t3({},e)}else if(i===1)if(WNe(r))n=u,t={};else{if(!r3(r))throw new TypeError(i3("invalid argument. Options argument must be an object. Value: `%s`.",r));t=t3({},r),n=a}else t={},n=a;return n;function a(o){return new n3(o,t)}function u(){return new n3(r,t)}}a3.exports=INe});var g3=s(function(P4e,o3){"use strict";var u3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Um=If(),zNe=e3(),kNe=s3();u3(Um,"objectMode",zNe);u3(Um,"factory",kNe);o3.exports=Um});var v3=s(function(_4e,JNe){JNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var l3=s(function(T4e,d3){"use strict";var UNe=require("@stdlib/assert/is-plain-object"),Ke=require("@stdlib/assert/has-own-property"),CNe=require("@stdlib/assert/is-boolean").isPrimitive,BNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,f3=require("@stdlib/assert/is-string").isPrimitive,XNe=require("@stdlib/assert/is-positive-integer").isPrimitive,DNe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bn=require("@stdlib/string/format");function YNe(r,e){return UNe(e)?Ke(e,"sep")&&(r.sep=e.sep,!f3(r.sep))?new TypeError(bn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ke(e,"objectMode")&&(r.objectMode=e.objectMode,!CNe(r.objectMode))?new TypeError(bn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ke(e,"encoding")&&(r.encoding=e.encoding,!f3(r.encoding)&&r.encoding!==null)?new TypeError(bn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ke(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!BNe(r.highWaterMark))?new TypeError(bn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ke(e,"iter")&&(r.iter=e.iter,!DNe(r.iter))?new TypeError(bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ke(e,"siter")&&(r.siter=e.siter,!XNe(r.siter))?new TypeError(bn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ke(e,"prng")&&(r.prng=e.prng),Ke(e,"seed")&&(r.seed=e.seed),Ke(e,"state")&&(r.state=e.state),Ke(e,"copy")&&(r.copy=e.copy),null):new TypeError(bn("invalid argument. Options argument must be an object. Value: `%s`.",e))}d3.exports=YNe});var m3=s(function(j4e,c3){"use strict";var HNe=require("debug"),ZNe=HNe("random:streams:chisquare");c3.exports=ZNe});var kf=s(function(M4e,q3){"use strict";var y3=require("readable-stream").Readable,QNe=require("@stdlib/assert/is-positive-number").isPrimitive,$Ne=require("@stdlib/assert/is-error"),KNe=require("@stdlib/object/assign"),eLe=require("@stdlib/utils/inherit"),h3=require("@stdlib/utils/define-nonenumerable-property"),qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),zf=require("@stdlib/utils/define-read-only-accessor"),rLe=require("@stdlib/utils/define-read-write-accessor"),tLe=St().factory,p3=require("@stdlib/buffer/from-string"),iLe=require("@stdlib/utils/next-tick"),nLe=require("@stdlib/string/format"),aLe=v3(),sLe=l3(),xa=m3();function uLe(){return this._prng.seed}function oLe(){return this._prng.seedLength}function gLe(){return this._prng.stateLength}function vLe(){return this._prng.byteLength}function fLe(){return this._prng.state}function dLe(r){this._prng.state=r}function lLe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return xa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),xa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=p3(e):e=p3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function cLe(r){var e;if(this._destroyed)return xa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,iLe(i),this;function i(){r&&(xa("Stream was destroyed due to an error. Error: %s.",$Ne(r)?r.message:JSON.stringify(r)),e.emit("error",r)),xa("Closing the stream..."),e.emit("close")}}function ue(r,e){var i,t;if(!(this instanceof ue))return arguments.length>1?new ue(r,e):new ue(r);if(!QNe(r))throw new TypeError(nLe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=KNe({},aLe),arguments.length>1&&(t=sLe(i,e),t))throw t;return xa("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),y3.call(this,i),h3(this,"_destroyed",!1),qi(this,"_objectMode",i.objectMode),qi(this,"_sep",i.sep),qi(this,"_iter",i.iter),qi(this,"_siter",i.siter),h3(this,"_i",0),qi(this,"_prng",tLe(r,i)),qi(this,"PRNG",this._prng.PRNG),this}eLe(ue,y3);zf(ue.prototype,"seed",uLe);zf(ue.prototype,"seedLength",oLe);rLe(ue.prototype,"state",fLe,dLe);zf(ue.prototype,"stateLength",gLe);zf(ue.prototype,"byteLength",vLe);qi(ue.prototype,"_read",lLe);qi(ue.prototype,"destroy",cLe);q3.exports=ue});var w3=s(function(x4e,b3){"use strict";var mLe=require("@stdlib/assert/is-plain-object"),hLe=require("@stdlib/object/assign"),pLe=require("@stdlib/string/format"),yLe=kf();function qLe(r,e){var i;if(arguments.length>1){if(i=e,!mLe(i))throw new TypeError(pLe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=hLe({},i)}else i={};return i.objectMode=!0,new yLe(r,i)}b3.exports=qLe});var R3=s(function(G4e,E3){"use strict";var bLe=require("@stdlib/assert/is-positive-number").isPrimitive,S3=require("@stdlib/assert/is-plain-object"),O3=require("@stdlib/object/assign"),N3=require("@stdlib/string/format"),L3=kf();function wLe(r,e){var i,t,n;if(i=arguments.length,i>1){if(!S3(e))throw new TypeError(N3("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=O3({},e)}else if(i===1)if(bLe(r))n=u,t={};else{if(!S3(r))throw new TypeError(N3("invalid argument. Options argument must be an object. Value: `%s`.",r));t=O3({},r),n=a}else t={},n=a;return n;function a(o){return new L3(o,t)}function u(){return new L3(r,t)}}E3.exports=wLe});var T3=s(function(A4e,_3){"use strict";var P3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cm=kf(),SLe=w3(),OLe=R3();P3(Cm,"objectMode",SLe);P3(Cm,"factory",OLe);_3.exports=Cm});var j3=s(function(V4e,NLe){NLe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var G3=s(function(F4e,x3){"use strict";var LLe=require("@stdlib/assert/is-plain-object"),er=require("@stdlib/assert/has-own-property"),ELe=require("@stdlib/assert/is-boolean").isPrimitive,RLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,M3=require("@stdlib/assert/is-string").isPrimitive,PLe=require("@stdlib/assert/is-positive-integer").isPrimitive,_Le=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wn=require("@stdlib/string/format");function TLe(r,e){return LLe(e)?er(e,"sep")&&(r.sep=e.sep,!M3(r.sep))?new TypeError(wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):er(e,"objectMode")&&(r.objectMode=e.objectMode,!ELe(r.objectMode))?new TypeError(wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):er(e,"encoding")&&(r.encoding=e.encoding,!M3(r.encoding)&&r.encoding!==null)?new TypeError(wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!RLe(r.highWaterMark))?new TypeError(wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):er(e,"iter")&&(r.iter=e.iter,!_Le(r.iter))?new TypeError(wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):er(e,"siter")&&(r.siter=e.siter,!PLe(r.siter))?new TypeError(wn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(er(e,"prng")&&(r.prng=e.prng),er(e,"seed")&&(r.seed=e.seed),er(e,"state")&&(r.state=e.state),er(e,"copy")&&(r.copy=e.copy),null):new TypeError(wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}x3.exports=TLe});var V3=s(function(W4e,A3){"use strict";var jLe=require("debug"),MLe=jLe("random:streams:cosine");A3.exports=MLe});var Uf=s(function(I4e,k3){"use strict";var z3=require("readable-stream").Readable,xLe=require("@stdlib/assert/is-positive-number").isPrimitive,GLe=require("@stdlib/assert/is-number").isPrimitive,ALe=require("@stdlib/math/base/assert/is-nan"),VLe=require("@stdlib/assert/is-error"),FLe=require("@stdlib/object/assign"),WLe=require("@stdlib/utils/inherit"),F3=require("@stdlib/utils/define-nonenumerable-property"),bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jf=require("@stdlib/utils/define-read-only-accessor"),ILe=require("@stdlib/utils/define-read-write-accessor"),zLe=nn().factory,W3=require("@stdlib/buffer/from-string"),kLe=require("@stdlib/utils/next-tick"),I3=require("@stdlib/string/format"),JLe=j3(),ULe=G3(),Ga=V3();function CLe(){return this._prng.seed}function BLe(){return this._prng.seedLength}function XLe(){return this._prng.stateLength}function DLe(){return this._prng.byteLength}function YLe(){return this._prng.state}function HLe(r){this._prng.state=r}function ZLe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ga("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ga("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=W3(e):e=W3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function QLe(r){var e;if(this._destroyed)return Ga("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,kLe(i),this;function i(){r&&(Ga("Stream was destroyed due to an error. Error: %s.",VLe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ga("Closing the stream..."),e.emit("close")}}function oe(r,e,i){var t,n;if(!(this instanceof oe))return arguments.length>2?new oe(r,e,i):new oe(r,e);if(!GLe(r)||ALe(r))throw new TypeError(I3("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!xLe(e))throw new TypeError(I3("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=FLe({},JLe),arguments.length>2&&(n=ULe(t,i),n))throw n;return Ga("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),z3.call(this,t),F3(this,"_destroyed",!1),bi(this,"_objectMode",t.objectMode),bi(this,"_sep",t.sep),bi(this,"_iter",t.iter),bi(this,"_siter",t.siter),F3(this,"_i",0),bi(this,"_prng",zLe(r,e,t)),bi(this,"PRNG",this._prng.PRNG),this}WLe(oe,z3);Jf(oe.prototype,"seed",CLe);Jf(oe.prototype,"seedLength",BLe);ILe(oe.prototype,"state",YLe,HLe);Jf(oe.prototype,"stateLength",XLe);Jf(oe.prototype,"byteLength",DLe);bi(oe.prototype,"_read",ZLe);bi(oe.prototype,"destroy",QLe);k3.exports=oe});var U3=s(function(z4e,J3){"use strict";var $Le=require("@stdlib/assert/is-plain-object"),KLe=require("@stdlib/object/assign"),eEe=require("@stdlib/string/format"),rEe=Uf();function tEe(r,e,i){var t;if(arguments.length>2){if(t=i,!$Le(t))throw new TypeError(eEe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=KLe({},i)}else t={};return t.objectMode=!0,new rEe(r,e,t)}J3.exports=tEe});var H3=s(function(k4e,Y3){"use strict";var C3=require("@stdlib/assert/is-plain-object"),B3=require("@stdlib/object/assign"),X3=require("@stdlib/string/format"),D3=Uf();function iEe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!C3(r))throw new TypeError(X3("invalid argument. Options argument must be an object. Value: `%s`.",r));n=B3({},r)}else if(t>2){if(!C3(i))throw new TypeError(X3("invalid argument. Options argument must be an object. Value: `%s`.",i));n=B3({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new D3(g,d,n)}function o(){return new D3(r,e,n)}}Y3.exports=iEe});var $3=s(function(J4e,Q3){"use strict";var Z3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bm=Uf(),nEe=U3(),aEe=H3();Z3(Bm,"objectMode",nEe);Z3(Bm,"factory",aEe);Q3.exports=Bm});var K3=s(function(U4e,sEe){sEe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var tJ=s(function(C4e,rJ){"use strict";var uEe=require("@stdlib/assert/is-plain-object"),rr=require("@stdlib/assert/has-own-property"),oEe=require("@stdlib/assert/is-boolean").isPrimitive,gEe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,eJ=require("@stdlib/assert/is-string").isPrimitive,vEe=require("@stdlib/assert/is-positive-integer").isPrimitive,fEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Sn=require("@stdlib/string/format");function dEe(r,e){return uEe(e)?rr(e,"sep")&&(r.sep=e.sep,!eJ(r.sep))?new TypeError(Sn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):rr(e,"objectMode")&&(r.objectMode=e.objectMode,!oEe(r.objectMode))?new TypeError(Sn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):rr(e,"encoding")&&(r.encoding=e.encoding,!eJ(r.encoding)&&r.encoding!==null)?new TypeError(Sn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!gEe(r.highWaterMark))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):rr(e,"iter")&&(r.iter=e.iter,!fEe(r.iter))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):rr(e,"siter")&&(r.siter=e.siter,!vEe(r.siter))?new TypeError(Sn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(rr(e,"prng")&&(r.prng=e.prng),rr(e,"seed")&&(r.seed=e.seed),rr(e,"state")&&(r.state=e.state),rr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Sn("invalid argument. Options argument must be an object. Value: `%s`.",e))}rJ.exports=dEe});var nJ=s(function(B4e,iJ){"use strict";var lEe=require("debug"),cEe=lEe("random:streams:discrete-uniform");iJ.exports=cEe});var Bf=s(function(X4e,gJ){"use strict";var oJ=require("readable-stream").Readable,aJ=require("@stdlib/assert/is-integer").isPrimitive,mEe=require("@stdlib/assert/is-error"),hEe=require("@stdlib/object/assign"),pEe=require("@stdlib/utils/inherit"),sJ=require("@stdlib/utils/define-nonenumerable-property"),wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cf=require("@stdlib/utils/define-read-only-accessor"),yEe=require("@stdlib/utils/define-read-write-accessor"),qEe=an().factory,uJ=require("@stdlib/buffer/from-string"),bEe=require("@stdlib/utils/next-tick"),Xm=require("@stdlib/string/format"),wEe=K3(),SEe=tJ(),Aa=nJ();function OEe(){return this._prng.seed}function NEe(){return this._prng.seedLength}function LEe(){return this._prng.stateLength}function EEe(){return this._prng.byteLength}function REe(){return this._prng.state}function PEe(r){this._prng.state=r}function _Ee(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Aa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Aa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=uJ(e):e=uJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function TEe(r){var e;if(this._destroyed)return Aa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,bEe(i),this;function i(){r&&(Aa("Stream was destroyed due to an error. Error: %s.",mEe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Aa("Closing the stream..."),e.emit("close")}}function ge(r,e,i){var t,n;if(!(this instanceof ge))return arguments.length>2?new ge(r,e,i):new ge(r,e);if(!aJ(r))throw new TypeError(Xm("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!aJ(e))throw new TypeError(Xm("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(Xm("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e));if(t=hEe({},wEe),arguments.length>2&&(n=SEe(t,i),n))throw n;return Aa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),oJ.call(this,t),sJ(this,"_destroyed",!1),wi(this,"_objectMode",t.objectMode),wi(this,"_sep",t.sep),wi(this,"_iter",t.iter),wi(this,"_siter",t.siter),sJ(this,"_i",0),wi(this,"_prng",qEe(r,e,t)),wi(this,"PRNG",this._prng.PRNG),this}pEe(ge,oJ);Cf(ge.prototype,"seed",OEe);Cf(ge.prototype,"seedLength",NEe);yEe(ge.prototype,"state",REe,PEe);Cf(ge.prototype,"stateLength",LEe);Cf(ge.prototype,"byteLength",EEe);wi(ge.prototype,"_read",_Ee);wi(ge.prototype,"destroy",TEe);gJ.exports=ge});var fJ=s(function(D4e,vJ){"use strict";var jEe=require("@stdlib/assert/is-plain-object"),MEe=require("@stdlib/object/assign"),xEe=require("@stdlib/string/format"),GEe=Bf();function AEe(r,e,i){var t;if(arguments.length>2){if(t=i,!jEe(t))throw new TypeError(xEe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=MEe({},i)}else t={};return t.objectMode=!0,new GEe(r,e,t)}vJ.exports=AEe});var pJ=s(function(Y4e,hJ){"use strict";var dJ=require("@stdlib/assert/is-plain-object"),lJ=require("@stdlib/object/assign"),cJ=require("@stdlib/string/format"),mJ=Bf();function VEe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!dJ(r))throw new TypeError(cJ("invalid argument. Options argument must be an object. Value: `%s`.",r));n=lJ({},r)}else if(t>2){if(!dJ(i))throw new TypeError(cJ("invalid argument. Options argument must be an object. Value: `%s`.",i));n=lJ({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new mJ(g,d,n)}function o(){return new mJ(r,e,n)}}hJ.exports=VEe});var bJ=s(function(H4e,qJ){"use strict";var yJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dm=Bf(),FEe=fJ(),WEe=pJ();yJ(Dm,"objectMode",FEe);yJ(Dm,"factory",WEe);qJ.exports=Dm});var wJ=s(function(Z4e,IEe){IEe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var NJ=s(function(Q4e,OJ){"use strict";var zEe=require("@stdlib/assert/is-plain-object"),tr=require("@stdlib/assert/has-own-property"),kEe=require("@stdlib/assert/is-boolean").isPrimitive,JEe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,SJ=require("@stdlib/assert/is-string").isPrimitive,UEe=require("@stdlib/assert/is-positive-integer").isPrimitive,CEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,On=require("@stdlib/string/format");function BEe(r,e){return zEe(e)?tr(e,"sep")&&(r.sep=e.sep,!SJ(r.sep))?new TypeError(On("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):tr(e,"objectMode")&&(r.objectMode=e.objectMode,!kEe(r.objectMode))?new TypeError(On("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):tr(e,"encoding")&&(r.encoding=e.encoding,!SJ(r.encoding)&&r.encoding!==null)?new TypeError(On("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!JEe(r.highWaterMark))?new TypeError(On("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):tr(e,"iter")&&(r.iter=e.iter,!CEe(r.iter))?new TypeError(On("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):tr(e,"siter")&&(r.siter=e.siter,!UEe(r.siter))?new TypeError(On("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(tr(e,"prng")&&(r.prng=e.prng),tr(e,"seed")&&(r.seed=e.seed),tr(e,"state")&&(r.state=e.state),tr(e,"copy")&&(r.copy=e.copy),null):new TypeError(On("invalid argument. Options argument must be an object. Value: `%s`.",e))}OJ.exports=BEe});var EJ=s(function($4e,LJ){"use strict";var XEe=require("debug"),DEe=XEe("random:streams:erlang");LJ.exports=DEe});var Df=s(function(K4e,jJ){"use strict";var TJ=require("readable-stream").Readable,YEe=require("@stdlib/assert/is-positive-integer").isPrimitive,HEe=require("@stdlib/assert/is-positive-number").isPrimitive,ZEe=require("@stdlib/assert/is-error"),QEe=require("@stdlib/object/assign"),$Ee=require("@stdlib/utils/inherit"),RJ=require("@stdlib/utils/define-nonenumerable-property"),Si=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xf=require("@stdlib/utils/define-read-only-accessor"),KEe=require("@stdlib/utils/define-read-write-accessor"),eRe=Xs().factory,PJ=require("@stdlib/buffer/from-string"),rRe=require("@stdlib/utils/next-tick"),_J=require("@stdlib/string/format"),tRe=wJ(),iRe=NJ(),Va=EJ();function nRe(){return this._prng.seed}function aRe(){return this._prng.seedLength}function sRe(){return this._prng.stateLength}function uRe(){return this._prng.byteLength}function oRe(){return this._prng.state}function gRe(r){this._prng.state=r}function vRe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Va("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Va("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=PJ(e):e=PJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function fRe(r){var e;if(this._destroyed)return Va("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rRe(i),this;function i(){r&&(Va("Stream was destroyed due to an error. Error: %s.",ZEe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Va("Closing the stream..."),e.emit("close")}}function ve(r,e,i){var t,n;if(!(this instanceof ve))return arguments.length>2?new ve(r,e,i):new ve(r,e);if(!YEe(r))throw new TypeError(_J("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!HEe(e))throw new TypeError(_J("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=QEe({},tRe),arguments.length>2&&(n=iRe(t,i),n))throw n;return Va("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),TJ.call(this,t),RJ(this,"_destroyed",!1),Si(this,"_objectMode",t.objectMode),Si(this,"_sep",t.sep),Si(this,"_iter",t.iter),Si(this,"_siter",t.siter),RJ(this,"_i",0),Si(this,"_prng",eRe(r,e,t)),Si(this,"PRNG",this._prng.PRNG),this}$Ee(ve,TJ);Xf(ve.prototype,"seed",nRe);Xf(ve.prototype,"seedLength",aRe);KEe(ve.prototype,"state",oRe,gRe);Xf(ve.prototype,"stateLength",sRe);Xf(ve.prototype,"byteLength",uRe);Si(ve.prototype,"_read",vRe);Si(ve.prototype,"destroy",fRe);jJ.exports=ve});var xJ=s(function(eYe,MJ){"use strict";var dRe=require("@stdlib/assert/is-plain-object"),lRe=require("@stdlib/object/assign"),cRe=require("@stdlib/string/format"),mRe=Df();function hRe(r,e,i){var t;if(arguments.length>2){if(t=i,!dRe(t))throw new TypeError(cRe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=lRe({},i)}else t={};return t.objectMode=!0,new mRe(r,e,t)}MJ.exports=hRe});var IJ=s(function(rYe,WJ){"use strict";var GJ=require("@stdlib/assert/is-plain-object"),AJ=require("@stdlib/object/assign"),VJ=require("@stdlib/string/format"),FJ=Df();function pRe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!GJ(r))throw new TypeError(VJ("invalid argument. Options argument must be an object. Value: `%s`.",r));n=AJ({},r)}else if(t>2){if(!GJ(i))throw new TypeError(VJ("invalid argument. Options argument must be an object. Value: `%s`.",i));n=AJ({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new FJ(g,d,n)}function o(){return new FJ(r,e,n)}}WJ.exports=pRe});var JJ=s(function(tYe,kJ){"use strict";var zJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ym=Df(),yRe=xJ(),qRe=IJ();zJ(Ym,"objectMode",yRe);zJ(Ym,"factory",qRe);kJ.exports=Ym});var UJ=s(function(iYe,bRe){bRe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var XJ=s(function(nYe,BJ){"use strict";var wRe=require("@stdlib/assert/is-plain-object"),ir=require("@stdlib/assert/has-own-property"),SRe=require("@stdlib/assert/is-boolean").isPrimitive,ORe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,CJ=require("@stdlib/assert/is-string").isPrimitive,NRe=require("@stdlib/assert/is-positive-integer").isPrimitive,LRe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nn=require("@stdlib/string/format");function ERe(r,e){return wRe(e)?ir(e,"sep")&&(r.sep=e.sep,!CJ(r.sep))?new TypeError(Nn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ir(e,"objectMode")&&(r.objectMode=e.objectMode,!SRe(r.objectMode))?new TypeError(Nn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ir(e,"encoding")&&(r.encoding=e.encoding,!CJ(r.encoding)&&r.encoding!==null)?new TypeError(Nn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ir(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!ORe(r.highWaterMark))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ir(e,"iter")&&(r.iter=e.iter,!LRe(r.iter))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ir(e,"siter")&&(r.siter=e.siter,!NRe(r.siter))?new TypeError(Nn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ir(e,"prng")&&(r.prng=e.prng),ir(e,"seed")&&(r.seed=e.seed),ir(e,"state")&&(r.state=e.state),ir(e,"copy")&&(r.copy=e.copy),null):new TypeError(Nn("invalid argument. Options argument must be an object. Value: `%s`.",e))}BJ.exports=ERe});var YJ=s(function(aYe,DJ){"use strict";var RRe=require("debug"),PRe=RRe("random:streams:exponential");DJ.exports=PRe});var Hf=s(function(sYe,$J){"use strict";var QJ=require("readable-stream").Readable,_Re=require("@stdlib/assert/is-positive-number").isPrimitive,TRe=require("@stdlib/assert/is-error"),jRe=require("@stdlib/object/assign"),MRe=require("@stdlib/utils/inherit"),HJ=require("@stdlib/utils/define-nonenumerable-property"),Oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yf=require("@stdlib/utils/define-read-only-accessor"),xRe=require("@stdlib/utils/define-read-write-accessor"),GRe=sn().factory,ZJ=require("@stdlib/buffer/from-string"),ARe=require("@stdlib/utils/next-tick"),VRe=require("@stdlib/string/format"),FRe=UJ(),WRe=XJ(),Fa=YJ();function IRe(){return this._prng.seed}function zRe(){return this._prng.seedLength}function kRe(){return this._prng.stateLength}function JRe(){return this._prng.byteLength}function URe(){return this._prng.state}function CRe(r){this._prng.state=r}function BRe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Fa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Fa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=ZJ(e):e=ZJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function XRe(r){var e;if(this._destroyed)return Fa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,ARe(i),this;function i(){r&&(Fa("Stream was destroyed due to an error. Error: %s.",TRe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Fa("Closing the stream..."),e.emit("close")}}function fe(r,e){var i,t;if(!(this instanceof fe))return arguments.length>1?new fe(r,e):new fe(r);if(!_Re(r))throw new TypeError(VRe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=jRe({},FRe),arguments.length>1&&(t=WRe(i,e),t))throw t;return Fa("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),QJ.call(this,i),HJ(this,"_destroyed",!1),Oi(this,"_objectMode",i.objectMode),Oi(this,"_sep",i.sep),Oi(this,"_iter",i.iter),Oi(this,"_siter",i.siter),HJ(this,"_i",0),Oi(this,"_prng",GRe(r,i)),Oi(this,"PRNG",this._prng.PRNG),this}MRe(fe,QJ);Yf(fe.prototype,"seed",IRe);Yf(fe.prototype,"seedLength",zRe);xRe(fe.prototype,"state",URe,CRe);Yf(fe.prototype,"stateLength",kRe);Yf(fe.prototype,"byteLength",JRe);Oi(fe.prototype,"_read",BRe);Oi(fe.prototype,"destroy",XRe);$J.exports=fe});var eU=s(function(uYe,KJ){"use strict";var DRe=require("@stdlib/assert/is-plain-object"),YRe=require("@stdlib/object/assign"),HRe=require("@stdlib/string/format"),ZRe=Hf();function QRe(r,e){var i;if(arguments.length>1){if(i=e,!DRe(i))throw new TypeError(HRe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=YRe({},e)}else i={};return i.objectMode=!0,new ZRe(r,i)}KJ.exports=QRe});var sU=s(function(oYe,aU){"use strict";var $Re=require("@stdlib/assert/is-positive-number").isPrimitive,rU=require("@stdlib/assert/is-plain-object"),tU=require("@stdlib/object/assign"),iU=require("@stdlib/string/format"),nU=Hf();function KRe(r,e){var i,t,n;if(i=arguments.length,i>1){if(!rU(e))throw new TypeError(iU("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=tU({},e)}else if(i===1)if($Re(r))n=u,t={};else{if(!rU(r))throw new TypeError(iU("invalid argument. Options argument must be an object. Value: `%s`.",r));t=tU({},r),n=a}else t={},n=a;return n;function a(o){return new nU(o,t)}function u(){return new nU(r,t)}}aU.exports=KRe});var gU=s(function(gYe,oU){"use strict";var uU=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hm=Hf(),ePe=eU(),rPe=sU();uU(Hm,"objectMode",ePe);uU(Hm,"factory",rPe);oU.exports=Hm});var vU=s(function(vYe,tPe){tPe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var lU=s(function(fYe,dU){"use strict";var iPe=require("@stdlib/assert/is-plain-object"),nr=require("@stdlib/assert/has-own-property"),nPe=require("@stdlib/assert/is-boolean").isPrimitive,aPe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,fU=require("@stdlib/assert/is-string").isPrimitive,sPe=require("@stdlib/assert/is-positive-integer").isPrimitive,uPe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ln=require("@stdlib/string/format");function oPe(r,e){return iPe(e)?nr(e,"sep")&&(r.sep=e.sep,!fU(r.sep))?new TypeError(Ln("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):nr(e,"objectMode")&&(r.objectMode=e.objectMode,!nPe(r.objectMode))?new TypeError(Ln("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):nr(e,"encoding")&&(r.encoding=e.encoding,!fU(r.encoding)&&r.encoding!==null)?new TypeError(Ln("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!aPe(r.highWaterMark))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):nr(e,"iter")&&(r.iter=e.iter,!uPe(r.iter))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):nr(e,"siter")&&(r.siter=e.siter,!sPe(r.siter))?new TypeError(Ln("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(nr(e,"prng")&&(r.prng=e.prng),nr(e,"seed")&&(r.seed=e.seed),nr(e,"state")&&(r.state=e.state),nr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ln("invalid argument. Options argument must be an object. Value: `%s`.",e))}dU.exports=oPe});var mU=s(function(dYe,cU){"use strict";var gPe=require("debug"),vPe=gPe("random:streams:f");cU.exports=vPe});var Qf=s(function(lYe,wU){"use strict";var bU=require("readable-stream").Readable,hU=require("@stdlib/assert/is-positive-number").isPrimitive,fPe=require("@stdlib/assert/is-error"),dPe=require("@stdlib/object/assign"),lPe=require("@stdlib/utils/inherit"),pU=require("@stdlib/utils/define-nonenumerable-property"),Ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zf=require("@stdlib/utils/define-read-only-accessor"),cPe=require("@stdlib/utils/define-read-write-accessor"),mPe=Ds().factory,yU=require("@stdlib/buffer/from-string"),hPe=require("@stdlib/utils/next-tick"),qU=require("@stdlib/string/format"),pPe=vU(),yPe=lU(),Wa=mU();function qPe(){return this._prng.seed}function bPe(){return this._prng.seedLength}function wPe(){return this._prng.stateLength}function SPe(){return this._prng.byteLength}function OPe(){return this._prng.state}function NPe(r){this._prng.state=r}function LPe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Wa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Wa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=yU(e):e=yU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function EPe(r){var e;if(this._destroyed)return Wa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,hPe(i),this;function i(){r&&(Wa("Stream was destroyed due to an error. Error: %s.",fPe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Wa("Closing the stream..."),e.emit("close")}}function de(r,e,i){var t,n;if(!(this instanceof de))return arguments.length>2?new de(r,e,i):new de(r,e);if(!hU(r))throw new TypeError(qU("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!hU(e))throw new TypeError(qU("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=dPe({},pPe),arguments.length>2&&(n=yPe(t,i),n))throw n;return Wa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),bU.call(this,t),pU(this,"_destroyed",!1),Ni(this,"_objectMode",t.objectMode),Ni(this,"_sep",t.sep),Ni(this,"_iter",t.iter),Ni(this,"_siter",t.siter),pU(this,"_i",0),Ni(this,"_prng",mPe(r,e,t)),Ni(this,"PRNG",this._prng.PRNG),this}lPe(de,bU);Zf(de.prototype,"seed",qPe);Zf(de.prototype,"seedLength",bPe);cPe(de.prototype,"state",OPe,NPe);Zf(de.prototype,"stateLength",wPe);Zf(de.prototype,"byteLength",SPe);Ni(de.prototype,"_read",LPe);Ni(de.prototype,"destroy",EPe);wU.exports=de});var OU=s(function(cYe,SU){"use strict";var RPe=require("@stdlib/assert/is-plain-object"),PPe=require("@stdlib/object/assign"),_Pe=require("@stdlib/string/format"),TPe=Qf();function jPe(r,e,i){var t;if(arguments.length>2){if(t=i,!RPe(t))throw new TypeError(_Pe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=PPe({},i)}else t={};return t.objectMode=!0,new TPe(r,e,t)}SU.exports=jPe});var _U=s(function(mYe,PU){"use strict";var NU=require("@stdlib/assert/is-plain-object"),LU=require("@stdlib/object/assign"),EU=require("@stdlib/string/format"),RU=Qf();function MPe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!NU(r))throw new TypeError(EU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=LU({},r)}else if(t>2){if(!NU(i))throw new TypeError(EU("invalid argument. Options argument must be an object. Value: `%s`.",i));n=LU({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new RU(g,d,n)}function o(){return new RU(r,e,n)}}PU.exports=MPe});var MU=s(function(hYe,jU){"use strict";var TU=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zm=Qf(),xPe=OU(),GPe=_U();TU(Zm,"objectMode",xPe);TU(Zm,"factory",GPe);jU.exports=Zm});var xU=s(function(pYe,APe){APe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var VU=s(function(yYe,AU){"use strict";var VPe=require("@stdlib/assert/is-plain-object"),ar=require("@stdlib/assert/has-own-property"),FPe=require("@stdlib/assert/is-boolean").isPrimitive,WPe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,GU=require("@stdlib/assert/is-string").isPrimitive,IPe=require("@stdlib/assert/is-positive-integer").isPrimitive,zPe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,En=require("@stdlib/string/format");function kPe(r,e){return VPe(e)?ar(e,"sep")&&(r.sep=e.sep,!GU(r.sep))?new TypeError(En("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ar(e,"objectMode")&&(r.objectMode=e.objectMode,!FPe(r.objectMode))?new TypeError(En("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ar(e,"encoding")&&(r.encoding=e.encoding,!GU(r.encoding)&&r.encoding!==null)?new TypeError(En("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ar(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!WPe(r.highWaterMark))?new TypeError(En("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ar(e,"iter")&&(r.iter=e.iter,!zPe(r.iter))?new TypeError(En("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ar(e,"siter")&&(r.siter=e.siter,!IPe(r.siter))?new TypeError(En("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ar(e,"prng")&&(r.prng=e.prng),ar(e,"seed")&&(r.seed=e.seed),ar(e,"state")&&(r.state=e.state),ar(e,"copy")&&(r.copy=e.copy),null):new TypeError(En("invalid argument. Options argument must be an object. Value: `%s`.",e))}AU.exports=kPe});var WU=s(function(qYe,FU){"use strict";var JPe=require("debug"),UPe=JPe("random:streams:frechet");FU.exports=UPe});var Kf=s(function(bYe,UU){"use strict";var JU=require("readable-stream").Readable,IU=require("@stdlib/assert/is-positive-number"),CPe=require("@stdlib/assert/is-number").isPrimitive,BPe=require("@stdlib/math/base/assert/is-nan"),XPe=require("@stdlib/assert/is-error"),DPe=require("@stdlib/object/assign"),YPe=require("@stdlib/utils/inherit"),zU=require("@stdlib/utils/define-nonenumerable-property"),Li=require("@stdlib/utils/define-nonenumerable-read-only-property"),$f=require("@stdlib/utils/define-read-only-accessor"),HPe=require("@stdlib/utils/define-read-write-accessor"),ZPe=Ys().factory,kU=require("@stdlib/buffer/from-string"),QPe=require("@stdlib/utils/next-tick"),Qm=require("@stdlib/string/format"),$Pe=xU(),KPe=VU(),Ia=WU();function e_e(){return this._prng.seed}function r_e(){return this._prng.seedLength}function t_e(){return this._prng.stateLength}function i_e(){return this._prng.byteLength}function n_e(){return this._prng.state}function a_e(r){this._prng.state=r}function s_e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ia("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ia("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=kU(e):e=kU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function u_e(r){var e;if(this._destroyed)return Ia("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,QPe(i),this;function i(){r&&(Ia("Stream was destroyed due to an error. Error: %s.",XPe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ia("Closing the stream..."),e.emit("close")}}function le(r,e,i,t){var n,a;if(!(this instanceof le))return arguments.length>3?new le(r,e,i,t):new le(r,e,i);if(!IU(r))throw new TypeError(Qm("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r));if(!IU(e))throw new TypeError(Qm("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e));if(!CPe(i)||BPe(i))throw new TypeError(Qm("invalid argument. Third argument must be a number. Value: `%s`.",i));if(n=DPe({},$Pe),arguments.length>3&&(a=KPe(n,t),a))throw a;return Ia("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),JU.call(this,n),zU(this,"_destroyed",!1),Li(this,"_objectMode",n.objectMode),Li(this,"_sep",n.sep),Li(this,"_iter",n.iter),Li(this,"_siter",n.siter),zU(this,"_i",0),Li(this,"_prng",ZPe(r,e,i,n)),Li(this,"PRNG",this._prng.PRNG),this}YPe(le,JU);$f(le.prototype,"seed",e_e);$f(le.prototype,"seedLength",r_e);HPe(le.prototype,"state",n_e,a_e);$f(le.prototype,"stateLength",t_e);$f(le.prototype,"byteLength",i_e);Li(le.prototype,"_read",s_e);Li(le.prototype,"destroy",u_e);UU.exports=le});var BU=s(function(wYe,CU){"use strict";var o_e=require("@stdlib/assert/is-plain-object"),g_e=require("@stdlib/object/assign"),v_e=require("@stdlib/string/format"),f_e=Kf();function d_e(r,e,i,t){var n;if(arguments.length>3){if(n=t,!o_e(n))throw new TypeError(v_e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=g_e({},t)}else n={};return n.objectMode=!0,new f_e(r,e,i,n)}CU.exports=d_e});var QU=s(function(SYe,ZU){"use strict";var XU=require("@stdlib/assert/is-plain-object"),DU=require("@stdlib/object/assign"),YU=require("@stdlib/string/format"),HU=Kf();function l_e(r,e,i,t){var n,a,u;if(n=arguments.length,n===1){if(!XU(r))throw new TypeError(YU("invalid argument. Options argument must be an object. Value: `%s`.",r));a=DU({},r)}else if(n>3){if(!XU(t))throw new TypeError(YU("invalid argument. Options argument must be an object. Value: `%s`.",t));a=DU({},t)}else a={};return n<3?u=o:u=g,u;function o(d,m,c){return new HU(d,m,c,a)}function g(){return new HU(r,e,i,a)}}ZU.exports=l_e});var eC=s(function(OYe,KU){"use strict";var $U=require("@stdlib/utils/define-nonenumerable-read-only-property"),$m=Kf(),c_e=BU(),m_e=QU();$U($m,"objectMode",c_e);$U($m,"factory",m_e);KU.exports=$m});var rC=s(function(NYe,h_e){h_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var nC=s(function(LYe,iC){"use strict";var p_e=require("@stdlib/assert/is-plain-object"),sr=require("@stdlib/assert/has-own-property"),y_e=require("@stdlib/assert/is-boolean").isPrimitive,q_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,tC=require("@stdlib/assert/is-string").isPrimitive,b_e=require("@stdlib/assert/is-positive-integer").isPrimitive,w_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rn=require("@stdlib/string/format");function S_e(r,e){return p_e(e)?sr(e,"sep")&&(r.sep=e.sep,!tC(r.sep))?new TypeError(Rn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):sr(e,"objectMode")&&(r.objectMode=e.objectMode,!y_e(r.objectMode))?new TypeError(Rn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):sr(e,"encoding")&&(r.encoding=e.encoding,!tC(r.encoding)&&r.encoding!==null)?new TypeError(Rn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):sr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!q_e(r.highWaterMark))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):sr(e,"iter")&&(r.iter=e.iter,!w_e(r.iter))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):sr(e,"siter")&&(r.siter=e.siter,!b_e(r.siter))?new TypeError(Rn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(sr(e,"prng")&&(r.prng=e.prng),sr(e,"seed")&&(r.seed=e.seed),sr(e,"state")&&(r.state=e.state),sr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Rn("invalid argument. Options argument must be an object. Value: `%s`.",e))}iC.exports=S_e});var sC=s(function(EYe,aC){"use strict";var O_e=require("debug"),N_e=O_e("random:streams:gamma");aC.exports=N_e});var rd=s(function(RYe,dC){"use strict";var fC=require("readable-stream").Readable,uC=require("@stdlib/assert/is-positive-number").isPrimitive,L_e=require("@stdlib/assert/is-error"),E_e=require("@stdlib/object/assign"),R_e=require("@stdlib/utils/inherit"),oC=require("@stdlib/utils/define-nonenumerable-property"),Ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),ed=require("@stdlib/utils/define-read-only-accessor"),P_e=require("@stdlib/utils/define-read-write-accessor"),__e=ze().factory,gC=require("@stdlib/buffer/from-string"),T_e=require("@stdlib/utils/next-tick"),vC=require("@stdlib/string/format"),j_e=rC(),M_e=nC(),za=sC();function x_e(){return this._prng.seed}function G_e(){return this._prng.seedLength}function A_e(){return this._prng.stateLength}function V_e(){return this._prng.byteLength}function F_e(){return this._prng.state}function W_e(r){this._prng.state=r}function I_e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return za("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),za("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=gC(e):e=gC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function z_e(r){var e;if(this._destroyed)return za("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,T_e(i),this;function i(){r&&(za("Stream was destroyed due to an error. Error: %s.",L_e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),za("Closing the stream..."),e.emit("close")}}function ce(r,e,i){var t,n;if(!(this instanceof ce))return arguments.length>2?new ce(r,e,i):new ce(r,e);if(!uC(r))throw new TypeError(vC("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!uC(e))throw new TypeError(vC("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=E_e({},j_e),arguments.length>2&&(n=M_e(t,i),n))throw n;return za("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),fC.call(this,t),oC(this,"_destroyed",!1),Ei(this,"_objectMode",t.objectMode),Ei(this,"_sep",t.sep),Ei(this,"_iter",t.iter),Ei(this,"_siter",t.siter),oC(this,"_i",0),Ei(this,"_prng",__e(r,e,t)),Ei(this,"PRNG",this._prng.PRNG),this}R_e(ce,fC);ed(ce.prototype,"seed",x_e);ed(ce.prototype,"seedLength",G_e);P_e(ce.prototype,"state",F_e,W_e);ed(ce.prototype,"stateLength",A_e);ed(ce.prototype,"byteLength",V_e);Ei(ce.prototype,"_read",I_e);Ei(ce.prototype,"destroy",z_e);dC.exports=ce});var cC=s(function(PYe,lC){"use strict";var k_e=require("@stdlib/assert/is-plain-object"),J_e=require("@stdlib/object/assign"),U_e=require("@stdlib/string/format"),C_e=rd();function B_e(r,e,i){var t;if(arguments.length>2){if(t=i,!k_e(t))throw new TypeError(U_e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=J_e({},i)}else t={};return t.objectMode=!0,new C_e(r,e,t)}lC.exports=B_e});var bC=s(function(_Ye,qC){"use strict";var mC=require("@stdlib/assert/is-plain-object"),hC=require("@stdlib/object/assign"),pC=require("@stdlib/string/format"),yC=rd();function X_e(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!mC(r))throw new TypeError(pC("invalid argument. Options argument must be an object. Value: `%s`.",r));n=hC({},r)}else if(t>2){if(!mC(i))throw new TypeError(pC("invalid argument. Options argument must be an object. Value: `%s`.",i));n=hC({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new yC(g,d,n)}function o(){return new yC(r,e,n)}}qC.exports=X_e});var OC=s(function(TYe,SC){"use strict";var wC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Km=rd(),D_e=cC(),Y_e=bC();wC(Km,"objectMode",D_e);wC(Km,"factory",Y_e);SC.exports=Km});var NC=s(function(jYe,H_e){H_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var RC=s(function(MYe,EC){"use strict";var Z_e=require("@stdlib/assert/is-plain-object"),ur=require("@stdlib/assert/has-own-property"),Q_e=require("@stdlib/assert/is-boolean").isPrimitive,$_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,LC=require("@stdlib/assert/is-string").isPrimitive,K_e=require("@stdlib/assert/is-positive-integer").isPrimitive,eTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Pn=require("@stdlib/string/format");function rTe(r,e){return Z_e(e)?ur(e,"sep")&&(r.sep=e.sep,!LC(r.sep))?new TypeError(Pn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ur(e,"objectMode")&&(r.objectMode=e.objectMode,!Q_e(r.objectMode))?new TypeError(Pn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ur(e,"encoding")&&(r.encoding=e.encoding,!LC(r.encoding)&&r.encoding!==null)?new TypeError(Pn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ur(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!$_e(r.highWaterMark))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ur(e,"iter")&&(r.iter=e.iter,!eTe(r.iter))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ur(e,"siter")&&(r.siter=e.siter,!K_e(r.siter))?new TypeError(Pn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ur(e,"prng")&&(r.prng=e.prng),ur(e,"seed")&&(r.seed=e.seed),ur(e,"state")&&(r.state=e.state),ur(e,"copy")&&(r.copy=e.copy),null):new TypeError(Pn("invalid argument. Options argument must be an object. Value: `%s`.",e))}EC.exports=rTe});var _C=s(function(xYe,PC){"use strict";var tTe=require("debug"),iTe=tTe("random:streams:geometric");PC.exports=iTe});var id=s(function(GYe,xC){"use strict";var MC=require("readable-stream").Readable,nTe=require("@stdlib/assert/is-probability").isPrimitive,aTe=require("@stdlib/assert/is-error"),sTe=require("@stdlib/object/assign"),uTe=require("@stdlib/utils/inherit"),TC=require("@stdlib/utils/define-nonenumerable-property"),Ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),td=require("@stdlib/utils/define-read-only-accessor"),oTe=require("@stdlib/utils/define-read-write-accessor"),gTe=aa().factory,jC=require("@stdlib/buffer/from-string"),vTe=require("@stdlib/utils/next-tick"),fTe=require("@stdlib/string/format"),dTe=NC(),lTe=RC(),ka=_C();function cTe(){return this._prng.seed}function mTe(){return this._prng.seedLength}function hTe(){return this._prng.stateLength}function pTe(){return this._prng.byteLength}function yTe(){return this._prng.state}function qTe(r){this._prng.state=r}function bTe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ka("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ka("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=jC(e):e=jC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function wTe(r){var e;if(this._destroyed)return ka("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,vTe(i),this;function i(){r&&(ka("Stream was destroyed due to an error. Error: %s.",aTe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ka("Closing the stream..."),e.emit("close")}}function me(r,e){var i,t;if(!(this instanceof me))return arguments.length>1?new me(r,e):new me(r);if(!nTe(r))throw new TypeError(fTe("invalid argument. First argument must be a probability. Value: `%s`.",r));if(i=sTe({},dTe),arguments.length>1&&(t=lTe(i,e),t))throw t;return ka("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),MC.call(this,i),TC(this,"_destroyed",!1),Ri(this,"_objectMode",i.objectMode),Ri(this,"_sep",i.sep),Ri(this,"_iter",i.iter),Ri(this,"_siter",i.siter),TC(this,"_i",0),Ri(this,"_prng",gTe(r,i)),Ri(this,"PRNG",this._prng.PRNG),this}uTe(me,MC);td(me.prototype,"seed",cTe);td(me.prototype,"seedLength",mTe);oTe(me.prototype,"state",yTe,qTe);td(me.prototype,"stateLength",hTe);td(me.prototype,"byteLength",pTe);Ri(me.prototype,"_read",bTe);Ri(me.prototype,"destroy",wTe);xC.exports=me});var AC=s(function(AYe,GC){"use strict";var STe=require("@stdlib/assert/is-plain-object"),OTe=require("@stdlib/object/assign"),NTe=require("@stdlib/string/format"),LTe=id();function ETe(r,e){var i;if(arguments.length>1){if(i=e,!STe(i))throw new TypeError(NTe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=OTe({},e)}else i={};return i.objectMode=!0,new LTe(r,i)}GC.exports=ETe});var kC=s(function(VYe,zC){"use strict";var RTe=require("@stdlib/assert/is-probability").isPrimitive,VC=require("@stdlib/assert/is-plain-object"),FC=require("@stdlib/object/assign"),WC=require("@stdlib/string/format"),IC=id();function PTe(r,e){var i,t,n;if(i=arguments.length,i>1){if(!VC(e))throw new TypeError(WC("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=FC({},e)}else if(i===1)if(RTe(r))n=u,t={};else{if(!VC(r))throw new TypeError(WC("invalid argument. Options argument must be an object. Value: `%s`.",r));t=FC({},r),n=a}else t={},n=a;return n;function a(o){return new IC(o,t)}function u(){return new IC(r,t)}}zC.exports=PTe});var CC=s(function(FYe,UC){"use strict";var JC=require("@stdlib/utils/define-nonenumerable-read-only-property"),eh=id(),_Te=AC(),TTe=kC();JC(eh,"objectMode",_Te);JC(eh,"factory",TTe);UC.exports=eh});var BC=s(function(WYe,jTe){jTe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var YC=s(function(IYe,DC){"use strict";var MTe=require("@stdlib/assert/is-plain-object"),or=require("@stdlib/assert/has-own-property"),xTe=require("@stdlib/assert/is-boolean").isPrimitive,GTe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,XC=require("@stdlib/assert/is-string").isPrimitive,ATe=require("@stdlib/assert/is-positive-integer").isPrimitive,VTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_n=require("@stdlib/string/format");function FTe(r,e){return MTe(e)?or(e,"sep")&&(r.sep=e.sep,!XC(r.sep))?new TypeError(_n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):or(e,"objectMode")&&(r.objectMode=e.objectMode,!xTe(r.objectMode))?new TypeError(_n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):or(e,"encoding")&&(r.encoding=e.encoding,!XC(r.encoding)&&r.encoding!==null)?new TypeError(_n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!GTe(r.highWaterMark))?new TypeError(_n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):or(e,"iter")&&(r.iter=e.iter,!VTe(r.iter))?new TypeError(_n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):or(e,"siter")&&(r.siter=e.siter,!ATe(r.siter))?new TypeError(_n("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(or(e,"prng")&&(r.prng=e.prng),or(e,"seed")&&(r.seed=e.seed),or(e,"state")&&(r.state=e.state),or(e,"copy")&&(r.copy=e.copy),null):new TypeError(_n("invalid argument. Options argument must be an object. Value: `%s`.",e))}DC.exports=FTe});var ZC=s(function(zYe,HC){"use strict";var WTe=require("debug"),ITe=WTe("random:streams:gumbel");HC.exports=ITe});var ad=s(function(kYe,rB){"use strict";var eB=require("readable-stream").Readable,zTe=require("@stdlib/assert/is-positive-number").isPrimitive,kTe=require("@stdlib/assert/is-number").isPrimitive,JTe=require("@stdlib/math/base/assert/is-nan"),UTe=require("@stdlib/assert/is-error"),CTe=require("@stdlib/object/assign"),BTe=require("@stdlib/utils/inherit"),QC=require("@stdlib/utils/define-nonenumerable-property"),Pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),nd=require("@stdlib/utils/define-read-only-accessor"),XTe=require("@stdlib/utils/define-read-write-accessor"),DTe=Hs().factory,$C=require("@stdlib/buffer/from-string"),YTe=require("@stdlib/utils/next-tick"),KC=require("@stdlib/string/format"),HTe=BC(),ZTe=YC(),Ja=ZC();function QTe(){return this._prng.seed}function $Te(){return this._prng.seedLength}function KTe(){return this._prng.stateLength}function e0e(){return this._prng.byteLength}function r0e(){return this._prng.state}function t0e(r){this._prng.state=r}function i0e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ja("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ja("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=$C(e):e=$C(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function n0e(r){var e;if(this._destroyed)return Ja("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,YTe(i),this;function i(){r&&(Ja("Stream was destroyed due to an error. Error: %s.",UTe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ja("Closing the stream..."),e.emit("close")}}function he(r,e,i){var t,n;if(!(this instanceof he))return arguments.length>2?new he(r,e,i):new he(r,e);if(!kTe(r)||JTe(r))throw new TypeError(KC("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!zTe(e))throw new TypeError(KC("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=CTe({},HTe),arguments.length>2&&(n=ZTe(t,i),n))throw n;return Ja("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),eB.call(this,t),QC(this,"_destroyed",!1),Pi(this,"_objectMode",t.objectMode),Pi(this,"_sep",t.sep),Pi(this,"_iter",t.iter),Pi(this,"_siter",t.siter),QC(this,"_i",0),Pi(this,"_prng",DTe(r,e,t)),Pi(this,"PRNG",this._prng.PRNG),this}BTe(he,eB);nd(he.prototype,"seed",QTe);nd(he.prototype,"seedLength",$Te);XTe(he.prototype,"state",r0e,t0e);nd(he.prototype,"stateLength",KTe);nd(he.prototype,"byteLength",e0e);Pi(he.prototype,"_read",i0e);Pi(he.prototype,"destroy",n0e);rB.exports=he});var iB=s(function(JYe,tB){"use strict";var a0e=require("@stdlib/assert/is-plain-object"),s0e=require("@stdlib/object/assign"),u0e=require("@stdlib/string/format"),o0e=ad();function g0e(r,e,i){var t;if(arguments.length>2){if(t=i,!a0e(t))throw new TypeError(u0e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=s0e({},i)}else t={};return t.objectMode=!0,new o0e(r,e,t)}tB.exports=g0e});var gB=s(function(UYe,oB){"use strict";var nB=require("@stdlib/assert/is-plain-object"),aB=require("@stdlib/object/assign"),sB=require("@stdlib/string/format"),uB=ad();function v0e(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!nB(r))throw new TypeError(sB("invalid argument. Options argument must be an object. Value: `%s`.",r));n=aB({},r)}else if(t>2){if(!nB(i))throw new TypeError(sB("invalid argument. Options argument must be an object. Value: `%s`.",i));n=aB({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new uB(g,d,n)}function o(){return new uB(r,e,n)}}oB.exports=v0e});var dB=s(function(CYe,fB){"use strict";var vB=require("@stdlib/utils/define-nonenumerable-read-only-property"),rh=ad(),f0e=iB(),d0e=gB();vB(rh,"objectMode",f0e);vB(rh,"factory",d0e);fB.exports=rh});var lB=s(function(BYe,l0e){l0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var hB=s(function(XYe,mB){"use strict";var c0e=require("@stdlib/assert/is-plain-object"),gr=require("@stdlib/assert/has-own-property"),m0e=require("@stdlib/assert/is-boolean").isPrimitive,h0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,cB=require("@stdlib/assert/is-string").isPrimitive,p0e=require("@stdlib/assert/is-positive-integer").isPrimitive,y0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tn=require("@stdlib/string/format");function q0e(r,e){return c0e(e)?gr(e,"sep")&&(r.sep=e.sep,!cB(r.sep))?new TypeError(Tn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):gr(e,"objectMode")&&(r.objectMode=e.objectMode,!m0e(r.objectMode))?new TypeError(Tn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):gr(e,"encoding")&&(r.encoding=e.encoding,!cB(r.encoding)&&r.encoding!==null)?new TypeError(Tn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):gr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!h0e(r.highWaterMark))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):gr(e,"iter")&&(r.iter=e.iter,!y0e(r.iter))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):gr(e,"siter")&&(r.siter=e.siter,!p0e(r.siter))?new TypeError(Tn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(gr(e,"prng")&&(r.prng=e.prng),gr(e,"seed")&&(r.seed=e.seed),gr(e,"state")&&(r.state=e.state),gr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Tn("invalid argument. Options argument must be an object. Value: `%s`.",e))}mB.exports=q0e});var yB=s(function(DYe,pB){"use strict";var b0e=require("debug"),w0e=b0e("random:streams:hypergeometric");pB.exports=w0e});var ud=s(function(YYe,SB){"use strict";var wB=require("readable-stream").Readable,th=require("@stdlib/assert/is-nonnegative-integer"),S0e=require("@stdlib/assert/is-error"),O0e=require("@stdlib/object/assign"),N0e=require("@stdlib/utils/inherit"),qB=require("@stdlib/utils/define-nonenumerable-property"),_i=require("@stdlib/utils/define-nonenumerable-read-only-property"),sd=require("@stdlib/utils/define-read-only-accessor"),L0e=require("@stdlib/utils/define-read-write-accessor"),E0e=Qs().factory,bB=require("@stdlib/buffer/from-string"),R0e=require("@stdlib/utils/next-tick"),ih=require("@stdlib/string/format"),P0e=lB(),_0e=hB(),Ua=yB();function T0e(){return this._prng.seed}function j0e(){return this._prng.seedLength}function M0e(){return this._prng.stateLength}function x0e(){return this._prng.byteLength}function G0e(){return this._prng.state}function A0e(r){this._prng.state=r}function V0e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ua("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ua("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=bB(e):e=bB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function F0e(r){var e;if(this._destroyed)return Ua("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,R0e(i),this;function i(){r&&(Ua("Stream was destroyed due to an error. Error: %s.",S0e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ua("Closing the stream..."),e.emit("close")}}function pe(r,e,i,t){var n,a;if(!(this instanceof pe))return arguments.length>3?new pe(r,e,i,t):new pe(r,e,i);if(!th(r))throw new TypeError(ih("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!th(e))throw new TypeError(ih("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!th(i))throw new TypeError(ih("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",i));if(i>r)throw new RangeError("invalid argument. Third argument must be less than or equal to the first argument.");if(e>r)throw new RangeError("invalid argument. Second argument must be less than or equal to the first argument.");if(n=O0e({},P0e),arguments.length>3&&(a=_0e(n,t),a))throw a;return Ua("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),wB.call(this,n),qB(this,"_destroyed",!1),_i(this,"_objectMode",n.objectMode),_i(this,"_sep",n.sep),_i(this,"_iter",n.iter),_i(this,"_siter",n.siter),qB(this,"_i",0),_i(this,"_prng",E0e(r,e,i,n)),_i(this,"PRNG",this._prng.PRNG),this}N0e(pe,wB);sd(pe.prototype,"seed",T0e);sd(pe.prototype,"seedLength",j0e);L0e(pe.prototype,"state",G0e,A0e);sd(pe.prototype,"stateLength",M0e);sd(pe.prototype,"byteLength",x0e);_i(pe.prototype,"_read",V0e);_i(pe.prototype,"destroy",F0e);SB.exports=pe});var NB=s(function(HYe,OB){"use strict";var W0e=require("@stdlib/assert/is-plain-object"),I0e=require("@stdlib/object/assign"),z0e=require("@stdlib/string/format"),k0e=ud();function J0e(r,e,i,t){var n;if(arguments.length>3){if(n=t,!W0e(n))throw new TypeError(z0e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=I0e({},t)}else n={};return n.objectMode=!0,new k0e(r,e,i,n)}OB.exports=J0e});var TB=s(function(ZYe,_B){"use strict";var LB=require("@stdlib/assert/is-plain-object"),EB=require("@stdlib/object/assign"),RB=require("@stdlib/string/format"),PB=ud();function U0e(r,e,i,t){var n,a,u;if(n=arguments.length,n===1){if(!LB(r))throw new TypeError(RB("invalid argument. Options argument must be an object. Value: `%s`.",r));a=EB({},r)}else if(n>3){if(!LB(t))throw new TypeError(RB("invalid argument. Options argument must be an object. Value: `%s`.",t));a=EB({},t)}else a={};return n<3?u=o:u=g,u;function o(d,m,c){return new PB(d,m,c,a)}function g(){return new PB(r,e,i,a)}}_B.exports=U0e});var xB=s(function(QYe,MB){"use strict";var jB=require("@stdlib/utils/define-nonenumerable-read-only-property"),nh=ud(),C0e=NB(),B0e=TB();jB(nh,"objectMode",C0e);jB(nh,"factory",B0e);MB.exports=nh});var GB=s(function($Ye,X0e){X0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var FB=s(function(KYe,VB){"use strict";var D0e=require("@stdlib/assert/is-plain-object"),vr=require("@stdlib/assert/has-own-property"),Y0e=require("@stdlib/assert/is-boolean").isPrimitive,H0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,AB=require("@stdlib/assert/is-string").isPrimitive,Z0e=require("@stdlib/assert/is-positive-integer").isPrimitive,Q0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jn=require("@stdlib/string/format");function $0e(r,e){return D0e(e)?vr(e,"sep")&&(r.sep=e.sep,!AB(r.sep))?new TypeError(jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):vr(e,"objectMode")&&(r.objectMode=e.objectMode,!Y0e(r.objectMode))?new TypeError(jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):vr(e,"encoding")&&(r.encoding=e.encoding,!AB(r.encoding)&&r.encoding!==null)?new TypeError(jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):vr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!H0e(r.highWaterMark))?new TypeError(jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):vr(e,"iter")&&(r.iter=e.iter,!Q0e(r.iter))?new TypeError(jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):vr(e,"siter")&&(r.siter=e.siter,!Z0e(r.siter))?new TypeError(jn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(vr(e,"prng")&&(r.prng=e.prng),vr(e,"seed")&&(r.seed=e.seed),vr(e,"state")&&(r.state=e.state),vr(e,"copy")&&(r.copy=e.copy),null):new TypeError(jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}VB.exports=$0e});var IB=s(function(eHe,WB){"use strict";var K0e=require("debug"),eje=K0e("random:streams:improved-ziggurat");WB.exports=eje});var gd=s(function(rHe,UB){"use strict";var JB=require("readable-stream").Readable,rje=require("@stdlib/assert/is-error"),tje=require("@stdlib/object/assign"),ije=require("@stdlib/utils/inherit"),zB=require("@stdlib/utils/define-nonenumerable-property"),Ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),od=require("@stdlib/utils/define-read-only-accessor"),nje=require("@stdlib/utils/define-read-write-accessor"),aje=Y().factory,kB=require("@stdlib/buffer/from-string"),sje=require("@stdlib/utils/next-tick"),uje=GB(),oje=FB(),Ca=IB();function gje(){return this._prng.seed}function vje(){return this._prng.seedLength}function fje(){return this._prng.stateLength}function dje(){return this._prng.byteLength}function lje(){return this._prng.state}function cje(r){this._prng.state=r}function mje(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ca("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ca("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=kB(e):e=kB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function hje(r){var e;if(this._destroyed)return Ca("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,sje(i),this;function i(){r&&(Ca("Stream was destroyed due to an error. Error: %s.",rje(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ca("Closing the stream..."),e.emit("close")}}function ye(r){var e,i;if(!(this instanceof ye))return arguments.length>0?new ye(r):new ye;if(e=tje({},uje),arguments.length>0&&(i=oje(e,r),i))throw i;return Ca("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),JB.call(this,e),zB(this,"_destroyed",!1),Ti(this,"_objectMode",e.objectMode),Ti(this,"_sep",e.sep),Ti(this,"_iter",e.iter),Ti(this,"_siter",e.siter),zB(this,"_i",0),Ti(this,"_prng",aje(e)),Ti(this,"PRNG",this._prng.PRNG),this}ije(ye,JB);od(ye.prototype,"seed",gje);od(ye.prototype,"seedLength",vje);nje(ye.prototype,"state",lje,cje);od(ye.prototype,"stateLength",fje);od(ye.prototype,"byteLength",dje);Ti(ye.prototype,"_read",mje);Ti(ye.prototype,"destroy",hje);UB.exports=ye});var BB=s(function(tHe,CB){"use strict";var pje=require("@stdlib/assert/is-plain-object"),yje=require("@stdlib/object/assign"),qje=require("@stdlib/string/format"),bje=gd();function wje(r){var e;if(arguments.length>0){if(e=r,!pje(e))throw new TypeError(qje("invalid argument. Options argument must be an object. Value: `%s`.",e));e=yje({},r)}else e={};return e.objectMode=!0,new bje(e)}CB.exports=wje});var DB=s(function(iHe,XB){"use strict";var Sje=require("@stdlib/assert/is-plain-object"),Oje=require("@stdlib/object/assign"),Nje=require("@stdlib/string/format"),Lje=gd();function Eje(r){var e;if(arguments.length>0){if(!Sje(r))throw new TypeError(Nje("invalid argument. Options argument must be an object. Value: `%s`.",r));e=Oje({},r)}else e={};return i;function i(){return new Lje(e)}}XB.exports=Eje});var ZB=s(function(nHe,HB){"use strict";var YB=require("@stdlib/utils/define-nonenumerable-read-only-property"),ah=gd(),Rje=BB(),Pje=DB();YB(ah,"objectMode",Rje);YB(ah,"factory",Pje);HB.exports=ah});var QB=s(function(aHe,_je){_je.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var e9=s(function(sHe,KB){"use strict";var Tje=require("@stdlib/assert/is-plain-object"),fr=require("@stdlib/assert/has-own-property"),jje=require("@stdlib/assert/is-boolean").isPrimitive,Mje=require("@stdlib/assert/is-nonnegative-number").isPrimitive,$B=require("@stdlib/assert/is-string").isPrimitive,xje=require("@stdlib/assert/is-positive-integer").isPrimitive,Gje=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mn=require("@stdlib/string/format");function Aje(r,e){return Tje(e)?fr(e,"sep")&&(r.sep=e.sep,!$B(r.sep))?new TypeError(Mn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):fr(e,"objectMode")&&(r.objectMode=e.objectMode,!jje(r.objectMode))?new TypeError(Mn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):fr(e,"encoding")&&(r.encoding=e.encoding,!$B(r.encoding)&&r.encoding!==null)?new TypeError(Mn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):fr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Mje(r.highWaterMark))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):fr(e,"iter")&&(r.iter=e.iter,!Gje(r.iter))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):fr(e,"siter")&&(r.siter=e.siter,!xje(r.siter))?new TypeError(Mn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(fr(e,"prng")&&(r.prng=e.prng),fr(e,"seed")&&(r.seed=e.seed),fr(e,"state")&&(r.state=e.state),fr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Mn("invalid argument. Options argument must be an object. Value: `%s`.",e))}KB.exports=Aje});var t9=s(function(uHe,r9){"use strict";var Vje=require("debug"),Fje=Vje("random:streams:invgamma");r9.exports=Fje});var fd=s(function(oHe,o9){"use strict";var u9=require("readable-stream").Readable,i9=require("@stdlib/assert/is-positive-number").isPrimitive,Wje=require("@stdlib/assert/is-error"),Ije=require("@stdlib/object/assign"),zje=require("@stdlib/utils/inherit"),n9=require("@stdlib/utils/define-nonenumerable-property"),ji=require("@stdlib/utils/define-nonenumerable-read-only-property"),vd=require("@stdlib/utils/define-read-only-accessor"),kje=require("@stdlib/utils/define-read-write-accessor"),Jje=un().factory,a9=require("@stdlib/buffer/from-string"),Uje=require("@stdlib/utils/next-tick"),s9=require("@stdlib/string/format"),Cje=QB(),Bje=e9(),Ba=t9();function Xje(){return this._prng.seed}function Dje(){return this._prng.seedLength}function Yje(){return this._prng.stateLength}function Hje(){return this._prng.byteLength}function Zje(){return this._prng.state}function Qje(r){this._prng.state=r}function $je(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ba("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ba("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=a9(e):e=a9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Kje(r){var e;if(this._destroyed)return Ba("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Uje(i),this;function i(){r&&(Ba("Stream was destroyed due to an error. Error: %s.",Wje(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ba("Closing the stream..."),e.emit("close")}}function qe(r,e,i){var t,n;if(!(this instanceof qe))return arguments.length>2?new qe(r,e,i):new qe(r,e);if(!i9(r))throw new TypeError(s9("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!i9(e))throw new TypeError(s9("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=Ije({},Cje),arguments.length>2&&(n=Bje(t,i),n))throw n;return Ba("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),u9.call(this,t),n9(this,"_destroyed",!1),ji(this,"_objectMode",t.objectMode),ji(this,"_sep",t.sep),ji(this,"_iter",t.iter),ji(this,"_siter",t.siter),n9(this,"_i",0),ji(this,"_prng",Jje(r,e,t)),ji(this,"PRNG",this._prng.PRNG),this}zje(qe,u9);vd(qe.prototype,"seed",Xje);vd(qe.prototype,"seedLength",Dje);kje(qe.prototype,"state",Zje,Qje);vd(qe.prototype,"stateLength",Yje);vd(qe.prototype,"byteLength",Hje);ji(qe.prototype,"_read",$je);ji(qe.prototype,"destroy",Kje);o9.exports=qe});var v9=s(function(gHe,g9){"use strict";var eMe=require("@stdlib/assert/is-plain-object"),rMe=require("@stdlib/object/assign"),tMe=require("@stdlib/string/format"),iMe=fd();function nMe(r,e,i){var t;if(arguments.length>2){if(t=i,!eMe(t))throw new TypeError(tMe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=rMe({},i)}else t={};return t.objectMode=!0,new iMe(r,e,t)}g9.exports=nMe});var h9=s(function(vHe,m9){"use strict";var f9=require("@stdlib/assert/is-plain-object"),d9=require("@stdlib/object/assign"),l9=require("@stdlib/string/format"),c9=fd();function aMe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!f9(r))throw new TypeError(l9("invalid argument. Options argument must be an object. Value: `%s`.",r));n=d9({},r)}else if(t>2){if(!f9(i))throw new TypeError(l9("invalid argument. Options argument must be an object. Value: `%s`.",i));n=d9({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new c9(g,d,n)}function o(){return new c9(r,e,n)}}m9.exports=aMe});var q9=s(function(fHe,y9){"use strict";var p9=require("@stdlib/utils/define-nonenumerable-read-only-property"),sh=fd(),sMe=v9(),uMe=h9();p9(sh,"objectMode",sMe);p9(sh,"factory",uMe);y9.exports=sh});var b9=s(function(dHe,oMe){oMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var O9=s(function(lHe,S9){"use strict";var gMe=require("@stdlib/assert/is-plain-object"),dr=require("@stdlib/assert/has-own-property"),vMe=require("@stdlib/assert/is-boolean").isPrimitive,fMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,w9=require("@stdlib/assert/is-string").isPrimitive,dMe=require("@stdlib/assert/is-positive-integer").isPrimitive,lMe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xn=require("@stdlib/string/format");function cMe(r,e){return gMe(e)?dr(e,"sep")&&(r.sep=e.sep,!w9(r.sep))?new TypeError(xn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):dr(e,"objectMode")&&(r.objectMode=e.objectMode,!vMe(r.objectMode))?new TypeError(xn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):dr(e,"encoding")&&(r.encoding=e.encoding,!w9(r.encoding)&&r.encoding!==null)?new TypeError(xn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):dr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!fMe(r.highWaterMark))?new TypeError(xn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):dr(e,"iter")&&(r.iter=e.iter,!lMe(r.iter))?new TypeError(xn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):dr(e,"siter")&&(r.siter=e.siter,!dMe(r.siter))?new TypeError(xn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(dr(e,"prng")&&(r.prng=e.prng),dr(e,"seed")&&(r.seed=e.seed),dr(e,"state")&&(r.state=e.state),dr(e,"copy")&&(r.copy=e.copy),null):new TypeError(xn("invalid argument. Options argument must be an object. Value: `%s`.",e))}S9.exports=cMe});var L9=s(function(cHe,N9){"use strict";var mMe=require("debug"),hMe=mMe("random:streams:kumaraswamy");N9.exports=hMe});var ld=s(function(mHe,j9){"use strict";var T9=require("readable-stream").Readable,E9=require("@stdlib/assert/is-positive-number").isPrimitive,pMe=require("@stdlib/assert/is-error"),yMe=require("@stdlib/object/assign"),qMe=require("@stdlib/utils/inherit"),R9=require("@stdlib/utils/define-nonenumerable-property"),Mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),dd=require("@stdlib/utils/define-read-only-accessor"),bMe=require("@stdlib/utils/define-read-write-accessor"),wMe=$s().factory,P9=require("@stdlib/buffer/from-string"),SMe=require("@stdlib/utils/next-tick"),_9=require("@stdlib/string/format"),OMe=b9(),NMe=O9(),Xa=L9();function LMe(){return this._prng.seed}function EMe(){return this._prng.seedLength}function RMe(){return this._prng.stateLength}function PMe(){return this._prng.byteLength}function _Me(){return this._prng.state}function TMe(r){this._prng.state=r}function jMe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Xa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Xa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=P9(e):e=P9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function MMe(r){var e;if(this._destroyed)return Xa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,SMe(i),this;function i(){r&&(Xa("Stream was destroyed due to an error. Error: %s.",pMe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Xa("Closing the stream..."),e.emit("close")}}function be(r,e,i){var t,n;if(!(this instanceof be))return arguments.length>2?new be(r,e,i):new be(r,e);if(!E9(r))throw new TypeError(_9("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!E9(e))throw new TypeError(_9("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=yMe({},OMe),arguments.length>2&&(n=NMe(t,i),n))throw n;return Xa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),T9.call(this,t),R9(this,"_destroyed",!1),Mi(this,"_objectMode",t.objectMode),Mi(this,"_sep",t.sep),Mi(this,"_iter",t.iter),Mi(this,"_siter",t.siter),R9(this,"_i",0),Mi(this,"_prng",wMe(r,e,t)),Mi(this,"PRNG",this._prng.PRNG),this}qMe(be,T9);dd(be.prototype,"seed",LMe);dd(be.prototype,"seedLength",EMe);bMe(be.prototype,"state",_Me,TMe);dd(be.prototype,"stateLength",RMe);dd(be.prototype,"byteLength",PMe);Mi(be.prototype,"_read",jMe);Mi(be.prototype,"destroy",MMe);j9.exports=be});var x9=s(function(hHe,M9){"use strict";var xMe=require("@stdlib/assert/is-plain-object"),GMe=require("@stdlib/object/assign"),AMe=require("@stdlib/string/format"),VMe=ld();function FMe(r,e,i){var t;if(arguments.length>2){if(t=i,!xMe(t))throw new TypeError(AMe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=GMe({},i)}else t={};return t.objectMode=!0,new VMe(r,e,t)}M9.exports=FMe});var I9=s(function(pHe,W9){"use strict";var G9=require("@stdlib/assert/is-plain-object"),A9=require("@stdlib/object/assign"),V9=require("@stdlib/string/format"),F9=ld();function WMe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!G9(r))throw new TypeError(V9("invalid argument. Options argument must be an object. Value: `%s`.",r));n=A9({},r)}else if(t>2){if(!G9(i))throw new TypeError(V9("invalid argument. Options argument must be an object. Value: `%s`.",i));n=A9({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new F9(g,d,n)}function o(){return new F9(r,e,n)}}W9.exports=WMe});var J9=s(function(yHe,k9){"use strict";var z9=require("@stdlib/utils/define-nonenumerable-read-only-property"),uh=ld(),IMe=x9(),zMe=I9();z9(uh,"objectMode",IMe);z9(uh,"factory",zMe);k9.exports=uh});var U9=s(function(qHe,kMe){kMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var X9=s(function(bHe,B9){"use strict";var JMe=require("@stdlib/assert/is-plain-object"),lr=require("@stdlib/assert/has-own-property"),UMe=require("@stdlib/assert/is-boolean").isPrimitive,CMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,C9=require("@stdlib/assert/is-string").isPrimitive,BMe=require("@stdlib/assert/is-positive-integer").isPrimitive,XMe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Gn=require("@stdlib/string/format");function DMe(r,e){return JMe(e)?lr(e,"sep")&&(r.sep=e.sep,!C9(r.sep))?new TypeError(Gn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):lr(e,"objectMode")&&(r.objectMode=e.objectMode,!UMe(r.objectMode))?new TypeError(Gn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):lr(e,"encoding")&&(r.encoding=e.encoding,!C9(r.encoding)&&r.encoding!==null)?new TypeError(Gn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!CMe(r.highWaterMark))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):lr(e,"iter")&&(r.iter=e.iter,!XMe(r.iter))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):lr(e,"siter")&&(r.siter=e.siter,!BMe(r.siter))?new TypeError(Gn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(lr(e,"prng")&&(r.prng=e.prng),lr(e,"seed")&&(r.seed=e.seed),lr(e,"state")&&(r.state=e.state),lr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Gn("invalid argument. Options argument must be an object. Value: `%s`.",e))}B9.exports=DMe});var Y9=s(function(wHe,D9){"use strict";var YMe=require("debug"),HMe=YMe("random:streams:laplace");D9.exports=HMe});var md=s(function(SHe,K9){"use strict";var $9=require("readable-stream").Readable,ZMe=require("@stdlib/assert/is-positive-number").isPrimitive,QMe=require("@stdlib/assert/is-number").isPrimitive,$Me=require("@stdlib/math/base/assert/is-nan"),KMe=require("@stdlib/assert/is-error"),e1e=require("@stdlib/object/assign"),r1e=require("@stdlib/utils/inherit"),H9=require("@stdlib/utils/define-nonenumerable-property"),xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),cd=require("@stdlib/utils/define-read-only-accessor"),t1e=require("@stdlib/utils/define-read-write-accessor"),i1e=Ks().factory,Z9=require("@stdlib/buffer/from-string"),Q9=require("@stdlib/string/format"),n1e=require("@stdlib/utils/next-tick"),a1e=U9(),s1e=X9(),Da=Y9();function u1e(){return this._prng.seed}function o1e(){return this._prng.seedLength}function g1e(){return this._prng.stateLength}function v1e(){return this._prng.byteLength}function f1e(){return this._prng.state}function d1e(r){this._prng.state=r}function l1e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Da("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Da("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Z9(e):e=Z9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function c1e(r){var e;if(this._destroyed)return Da("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,n1e(i),this;function i(){r&&(Da("Stream was destroyed due to an error. Error: %s.",KMe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Da("Closing the stream..."),e.emit("close")}}function we(r,e,i){var t,n;if(!(this instanceof we))return arguments.length>2?new we(r,e,i):new we(r,e);if(!QMe(r)||$Me(r))throw new TypeError(Q9("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!ZMe(e))throw new TypeError(Q9("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=e1e({},a1e),arguments.length>2&&(n=s1e(t,i),n))throw n;return Da("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),$9.call(this,t),H9(this,"_destroyed",!1),xi(this,"_objectMode",t.objectMode),xi(this,"_sep",t.sep),xi(this,"_iter",t.iter),xi(this,"_siter",t.siter),H9(this,"_i",0),xi(this,"_prng",i1e(r,e,t)),xi(this,"PRNG",this._prng.PRNG),this}r1e(we,$9);cd(we.prototype,"seed",u1e);cd(we.prototype,"seedLength",o1e);t1e(we.prototype,"state",f1e,d1e);cd(we.prototype,"stateLength",g1e);cd(we.prototype,"byteLength",v1e);xi(we.prototype,"_read",l1e);xi(we.prototype,"destroy",c1e);K9.exports=we});var r8=s(function(OHe,e8){"use strict";var m1e=require("@stdlib/assert/is-plain-object"),h1e=require("@stdlib/object/assign"),p1e=require("@stdlib/string/format"),y1e=md();function q1e(r,e,i){var t;if(arguments.length>2){if(t=i,!m1e(t))throw new TypeError(p1e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=h1e({},i)}else t={};return t.objectMode=!0,new y1e(r,e,t)}e8.exports=q1e});var u8=s(function(NHe,s8){"use strict";var t8=require("@stdlib/assert/is-plain-object"),i8=require("@stdlib/object/assign"),n8=require("@stdlib/string/format"),a8=md();function b1e(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!t8(r))throw new TypeError(n8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=i8({},r)}else if(t>2){if(!t8(i))throw new TypeError(n8("invalid argument. Options argument must be an object. Value: `%s`.",i));n=i8({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new a8(g,d,n)}function o(){return new a8(r,e,n)}}s8.exports=b1e});var v8=s(function(LHe,g8){"use strict";var o8=require("@stdlib/utils/define-nonenumerable-read-only-property"),oh=md(),w1e=r8(),S1e=u8();o8(oh,"objectMode",w1e);o8(oh,"factory",S1e);g8.exports=oh});var f8=s(function(EHe,O1e){O1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var c8=s(function(RHe,l8){"use strict";var N1e=require("@stdlib/assert/is-plain-object"),cr=require("@stdlib/assert/has-own-property"),L1e=require("@stdlib/assert/is-boolean").isPrimitive,E1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,d8=require("@stdlib/assert/is-string").isPrimitive,R1e=require("@stdlib/assert/is-positive-integer").isPrimitive,P1e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,An=require("@stdlib/string/format");function _1e(r,e){return N1e(e)?cr(e,"sep")&&(r.sep=e.sep,!d8(r.sep))?new TypeError(An("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):cr(e,"objectMode")&&(r.objectMode=e.objectMode,!L1e(r.objectMode))?new TypeError(An("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):cr(e,"encoding")&&(r.encoding=e.encoding,!d8(r.encoding)&&r.encoding!==null)?new TypeError(An("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):cr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!E1e(r.highWaterMark))?new TypeError(An("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):cr(e,"iter")&&(r.iter=e.iter,!P1e(r.iter))?new TypeError(An("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):cr(e,"siter")&&(r.siter=e.siter,!R1e(r.siter))?new TypeError(An("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(cr(e,"prng")&&(r.prng=e.prng),cr(e,"seed")&&(r.seed=e.seed),cr(e,"state")&&(r.state=e.state),cr(e,"copy")&&(r.copy=e.copy),null):new TypeError(An("invalid argument. Options argument must be an object. Value: `%s`.",e))}l8.exports=_1e});var h8=s(function(PHe,m8){"use strict";var T1e=require("debug"),j1e=T1e("random:streams:levy");m8.exports=j1e});var pd=s(function(_He,w8){"use strict";var b8=require("readable-stream").Readable,M1e=require("@stdlib/assert/is-positive-number").isPrimitive,x1e=require("@stdlib/assert/is-number").isPrimitive,G1e=require("@stdlib/math/base/assert/is-nan"),A1e=require("@stdlib/assert/is-error"),V1e=require("@stdlib/object/assign"),F1e=require("@stdlib/utils/inherit"),p8=require("@stdlib/utils/define-nonenumerable-property"),Gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),hd=require("@stdlib/utils/define-read-only-accessor"),W1e=require("@stdlib/utils/define-read-write-accessor"),I1e=eu().factory,y8=require("@stdlib/buffer/from-string"),z1e=require("@stdlib/utils/next-tick"),q8=require("@stdlib/string/format"),k1e=f8(),J1e=c8(),Ya=h8();function U1e(){return this._prng.seed}function C1e(){return this._prng.seedLength}function B1e(){return this._prng.stateLength}function X1e(){return this._prng.byteLength}function D1e(){return this._prng.state}function Y1e(r){this._prng.state=r}function H1e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ya("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ya("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=y8(e):e=y8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Z1e(r){var e;if(this._destroyed)return Ya("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,z1e(i),this;function i(){r&&(Ya("Stream was destroyed due to an error. Error: %s.",A1e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ya("Closing the stream..."),e.emit("close")}}function Se(r,e,i){var t,n;if(!(this instanceof Se))return arguments.length>2?new Se(r,e,i):new Se(r,e);if(!x1e(r)||G1e(r))throw new TypeError(q8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!M1e(e))throw new TypeError(q8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=V1e({},k1e),arguments.length>2&&(n=J1e(t,i),n))throw n;return Ya("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),b8.call(this,t),p8(this,"_destroyed",!1),Gi(this,"_objectMode",t.objectMode),Gi(this,"_sep",t.sep),Gi(this,"_iter",t.iter),Gi(this,"_siter",t.siter),p8(this,"_i",0),Gi(this,"_prng",I1e(r,e,t)),Gi(this,"PRNG",this._prng.PRNG),this}F1e(Se,b8);hd(Se.prototype,"seed",U1e);hd(Se.prototype,"seedLength",C1e);W1e(Se.prototype,"state",D1e,Y1e);hd(Se.prototype,"stateLength",B1e);hd(Se.prototype,"byteLength",X1e);Gi(Se.prototype,"_read",H1e);Gi(Se.prototype,"destroy",Z1e);w8.exports=Se});var O8=s(function(THe,S8){"use strict";var Q1e=require("@stdlib/assert/is-plain-object"),$1e=require("@stdlib/object/assign"),K1e=require("@stdlib/string/format"),exe=pd();function rxe(r,e,i){var t;if(arguments.length>2){if(t=i,!Q1e(t))throw new TypeError(K1e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=$1e({},i)}else t={};return t.objectMode=!0,new exe(r,e,t)}S8.exports=rxe});var _8=s(function(jHe,P8){"use strict";var N8=require("@stdlib/assert/is-plain-object"),L8=require("@stdlib/object/assign"),E8=require("@stdlib/string/format"),R8=pd();function txe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!N8(r))throw new TypeError(E8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=L8({},r)}else if(t>2){if(!N8(i))throw new TypeError(E8("invalid argument. Options argument must be an object. Value: `%s`.",i));n=L8({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new R8(g,d,n)}function o(){return new R8(r,e,n)}}P8.exports=txe});var M8=s(function(MHe,j8){"use strict";var T8=require("@stdlib/utils/define-nonenumerable-read-only-property"),gh=pd(),ixe=O8(),nxe=_8();T8(gh,"objectMode",ixe);T8(gh,"factory",nxe);j8.exports=gh});var x8=s(function(xHe,axe){axe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var V8=s(function(GHe,A8){"use strict";var sxe=require("@stdlib/assert/is-plain-object"),mr=require("@stdlib/assert/has-own-property"),uxe=require("@stdlib/assert/is-boolean").isPrimitive,oxe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,G8=require("@stdlib/assert/is-string").isPrimitive,gxe=require("@stdlib/assert/is-positive-integer").isPrimitive,vxe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vn=require("@stdlib/string/format");function fxe(r,e){return sxe(e)?mr(e,"sep")&&(r.sep=e.sep,!G8(r.sep))?new TypeError(Vn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):mr(e,"objectMode")&&(r.objectMode=e.objectMode,!uxe(r.objectMode))?new TypeError(Vn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):mr(e,"encoding")&&(r.encoding=e.encoding,!G8(r.encoding)&&r.encoding!==null)?new TypeError(Vn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!oxe(r.highWaterMark))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):mr(e,"iter")&&(r.iter=e.iter,!vxe(r.iter))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):mr(e,"siter")&&(r.siter=e.siter,!gxe(r.siter))?new TypeError(Vn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(mr(e,"prng")&&(r.prng=e.prng),mr(e,"seed")&&(r.seed=e.seed),mr(e,"state")&&(r.state=e.state),mr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Vn("invalid argument. Options argument must be an object. Value: `%s`.",e))}A8.exports=fxe});var W8=s(function(AHe,F8){"use strict";var dxe=require("debug"),lxe=dxe("random:streams:logistic");F8.exports=lxe});var qd=s(function(VHe,U8){"use strict";var J8=require("readable-stream").Readable,cxe=require("@stdlib/assert/is-positive-number").isPrimitive,mxe=require("@stdlib/assert/is-number").isPrimitive,hxe=require("@stdlib/math/base/assert/is-nan"),pxe=require("@stdlib/assert/is-error"),yxe=require("@stdlib/object/assign"),qxe=require("@stdlib/utils/inherit"),I8=require("@stdlib/utils/define-nonenumerable-property"),Ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),yd=require("@stdlib/utils/define-read-only-accessor"),bxe=require("@stdlib/utils/define-read-write-accessor"),wxe=ru().factory,z8=require("@stdlib/buffer/from-string"),Sxe=require("@stdlib/utils/next-tick"),k8=require("@stdlib/string/format"),Oxe=x8(),Nxe=V8(),Ha=W8();function Lxe(){return this._prng.seed}function Exe(){return this._prng.seedLength}function Rxe(){return this._prng.stateLength}function Pxe(){return this._prng.byteLength}function _xe(){return this._prng.state}function Txe(r){this._prng.state=r}function jxe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ha("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ha("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=z8(e):e=z8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Mxe(r){var e;if(this._destroyed)return Ha("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Sxe(i),this;function i(){r&&(Ha("Stream was destroyed due to an error. Error: %s.",pxe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ha("Closing the stream..."),e.emit("close")}}function Oe(r,e,i){var t,n;if(!(this instanceof Oe))return arguments.length>2?new Oe(r,e,i):new Oe(r,e);if(!mxe(r)||hxe(r))throw new TypeError(k8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!cxe(e))throw new TypeError(k8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=yxe({},Oxe),arguments.length>2&&(n=Nxe(t,i),n))throw n;return Ha("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),J8.call(this,t),I8(this,"_destroyed",!1),Ai(this,"_objectMode",t.objectMode),Ai(this,"_sep",t.sep),Ai(this,"_iter",t.iter),Ai(this,"_siter",t.siter),I8(this,"_i",0),Ai(this,"_prng",wxe(r,e,t)),Ai(this,"PRNG",this._prng.PRNG),this}qxe(Oe,J8);yd(Oe.prototype,"seed",Lxe);yd(Oe.prototype,"seedLength",Exe);bxe(Oe.prototype,"state",_xe,Txe);yd(Oe.prototype,"stateLength",Rxe);yd(Oe.prototype,"byteLength",Pxe);Ai(Oe.prototype,"_read",jxe);Ai(Oe.prototype,"destroy",Mxe);U8.exports=Oe});var B8=s(function(FHe,C8){"use strict";var xxe=require("@stdlib/assert/is-plain-object"),Gxe=require("@stdlib/object/assign"),Axe=require("@stdlib/string/format"),Vxe=qd();function Fxe(r,e,i){var t;if(arguments.length>2){if(t=i,!xxe(t))throw new TypeError(Axe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=Gxe({},i)}else t={};return t.objectMode=!0,new Vxe(r,e,t)}C8.exports=Fxe});var Q8=s(function(WHe,Z8){"use strict";var X8=require("@stdlib/assert/is-plain-object"),D8=require("@stdlib/object/assign"),Y8=require("@stdlib/string/format"),H8=qd();function Wxe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!X8(r))throw new TypeError(Y8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=D8({},r)}else if(t>2){if(!X8(i))throw new TypeError(Y8("invalid argument. Options argument must be an object. Value: `%s`.",i));n=D8({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new H8(g,d,n)}function o(){return new H8(r,e,n)}}Z8.exports=Wxe});var eX=s(function(IHe,K8){"use strict";var $8=require("@stdlib/utils/define-nonenumerable-read-only-property"),vh=qd(),Ixe=B8(),zxe=Q8();$8(vh,"objectMode",Ixe);$8(vh,"factory",zxe);K8.exports=vh});var rX=s(function(zHe,kxe){kxe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var nX=s(function(kHe,iX){"use strict";var Jxe=require("@stdlib/assert/is-plain-object"),hr=require("@stdlib/assert/has-own-property"),Uxe=require("@stdlib/assert/is-boolean").isPrimitive,Cxe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,tX=require("@stdlib/assert/is-string").isPrimitive,Bxe=require("@stdlib/assert/is-positive-integer").isPrimitive,Xxe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fn=require("@stdlib/string/format");function Dxe(r,e){return Jxe(e)?hr(e,"sep")&&(r.sep=e.sep,!tX(r.sep))?new TypeError(Fn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):hr(e,"objectMode")&&(r.objectMode=e.objectMode,!Uxe(r.objectMode))?new TypeError(Fn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):hr(e,"encoding")&&(r.encoding=e.encoding,!tX(r.encoding)&&r.encoding!==null)?new TypeError(Fn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):hr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Cxe(r.highWaterMark))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):hr(e,"iter")&&(r.iter=e.iter,!Xxe(r.iter))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):hr(e,"siter")&&(r.siter=e.siter,!Bxe(r.siter))?new TypeError(Fn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(hr(e,"prng")&&(r.prng=e.prng),hr(e,"seed")&&(r.seed=e.seed),hr(e,"state")&&(r.state=e.state),hr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Fn("invalid argument. Options argument must be an object. Value: `%s`.",e))}iX.exports=Dxe});var sX=s(function(JHe,aX){"use strict";var Yxe=require("debug"),Hxe=Yxe("random:streams:lognormal");aX.exports=Hxe});var wd=s(function(UHe,fX){"use strict";var vX=require("readable-stream").Readable,Zxe=require("@stdlib/assert/is-positive-number").isPrimitive,Qxe=require("@stdlib/assert/is-number").isPrimitive,$xe=require("@stdlib/math/base/assert/is-nan"),Kxe=require("@stdlib/assert/is-error"),eGe=require("@stdlib/object/assign"),rGe=require("@stdlib/utils/inherit"),uX=require("@stdlib/utils/define-nonenumerable-property"),Vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),bd=require("@stdlib/utils/define-read-only-accessor"),tGe=require("@stdlib/utils/define-read-write-accessor"),iGe=on().factory,oX=require("@stdlib/buffer/from-string"),nGe=require("@stdlib/utils/next-tick"),gX=require("@stdlib/string/format"),aGe=rX(),sGe=nX(),Za=sX();function uGe(){return this._prng.seed}function oGe(){return this._prng.seedLength}function gGe(){return this._prng.stateLength}function vGe(){return this._prng.byteLength}function fGe(){return this._prng.state}function dGe(r){this._prng.state=r}function lGe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Za("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Za("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=oX(e):e=oX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function cGe(r){var e;if(this._destroyed)return Za("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,nGe(i),this;function i(){r&&(Za("Stream was destroyed due to an error. Error: %s.",Kxe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Za("Closing the stream..."),e.emit("close")}}function Ne(r,e,i){var t,n;if(!(this instanceof Ne))return arguments.length>2?new Ne(r,e,i):new Ne(r,e);if(!Qxe(r)||$xe(r))throw new TypeError(gX("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Zxe(e))throw new TypeError(gX("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=eGe({},aGe),arguments.length>2&&(n=sGe(t,i),n))throw n;return Za("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),vX.call(this,t),uX(this,"_destroyed",!1),Vi(this,"_objectMode",t.objectMode),Vi(this,"_sep",t.sep),Vi(this,"_iter",t.iter),Vi(this,"_siter",t.siter),uX(this,"_i",0),Vi(this,"_prng",iGe(r,e,t)),Vi(this,"PRNG",this._prng.PRNG),this}rGe(Ne,vX);bd(Ne.prototype,"seed",uGe);bd(Ne.prototype,"seedLength",oGe);tGe(Ne.prototype,"state",fGe,dGe);bd(Ne.prototype,"stateLength",gGe);bd(Ne.prototype,"byteLength",vGe);Vi(Ne.prototype,"_read",lGe);Vi(Ne.prototype,"destroy",cGe);fX.exports=Ne});var lX=s(function(CHe,dX){"use strict";var mGe=require("@stdlib/assert/is-plain-object"),hGe=require("@stdlib/object/assign"),pGe=require("@stdlib/string/format"),yGe=wd();function qGe(r,e,i){var t;if(arguments.length>2){if(t=i,!mGe(t))throw new TypeError(pGe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=hGe({},i)}else t={};return t.objectMode=!0,new yGe(r,e,t)}dX.exports=qGe});var qX=s(function(BHe,yX){"use strict";var cX=require("@stdlib/assert/is-plain-object"),mX=require("@stdlib/object/assign"),hX=require("@stdlib/string/format"),pX=wd();function bGe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!cX(r))throw new TypeError(hX("invalid argument. Options argument must be an object. Value: `%s`.",r));n=mX({},r)}else if(t>2){if(!cX(i))throw new TypeError(hX("invalid argument. Options argument must be an object. Value: `%s`.",i));n=mX({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new pX(g,d,n)}function o(){return new pX(r,e,n)}}yX.exports=bGe});var SX=s(function(XHe,wX){"use strict";var bX=require("@stdlib/utils/define-nonenumerable-read-only-property"),fh=wd(),wGe=lX(),SGe=qX();bX(fh,"objectMode",wGe);bX(fh,"factory",SGe);wX.exports=fh});var OX=s(function(DHe,OGe){OGe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var RX=s(function(YHe,EX){"use strict";var NGe=require("@stdlib/assert/is-plain-object"),pr=require("@stdlib/assert/has-own-property"),NX=require("@stdlib/assert/is-boolean").isPrimitive,LGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,LX=require("@stdlib/assert/is-string").isPrimitive,EGe=require("@stdlib/assert/is-positive-integer").isPrimitive,RGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fi=require("@stdlib/string/format");function PGe(r,e){return NGe(e)?pr(e,"sep")&&(r.sep=e.sep,!LX(r.sep))?new TypeError(Fi("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):pr(e,"objectMode")&&(r.objectMode=e.objectMode,!NX(r.objectMode))?new TypeError(Fi("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):pr(e,"encoding")&&(r.encoding=e.encoding,!LX(r.encoding)&&r.encoding!==null)?new TypeError(Fi("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!LGe(r.highWaterMark))?new TypeError(Fi("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):pr(e,"iter")&&(r.iter=e.iter,!RGe(r.iter))?new TypeError(Fi("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):pr(e,"siter")&&(r.siter=e.siter,!EGe(r.siter))?new TypeError(Fi("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):pr(e,"normalized")&&(r.normalized=e.normalized,!NX(r.normalized))?new TypeError(Fi("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(pr(e,"seed")&&(r.seed=e.seed),pr(e,"state")&&(r.state=e.state),pr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Fi("invalid argument. Options argument must be an object. Value: `%s`.",e))}EX.exports=PGe});var _X=s(function(HHe,PX){"use strict";var _Ge=require("debug"),TGe=_Ge("random:streams:minstd");PX.exports=TGe});var Od=s(function(ZHe,xX){"use strict";var MX=require("readable-stream").Readable,jGe=require("@stdlib/assert/is-error"),MGe=require("@stdlib/object/assign"),xGe=require("@stdlib/utils/inherit"),TX=require("@stdlib/utils/define-nonenumerable-property"),Wn=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sd=require("@stdlib/utils/define-read-only-accessor"),GGe=require("@stdlib/utils/define-read-write-accessor"),AGe=H().factory,jX=require("@stdlib/buffer/from-string"),VGe=require("@stdlib/utils/next-tick"),FGe=OX(),WGe=RX(),Qa=_X();function IGe(){return this._prng.seed}function zGe(){return this._prng.seedLength}function kGe(){return this._prng.stateLength}function JGe(){return this._prng.byteLength}function UGe(){return this._prng.state}function CGe(r){this._prng.state=r}function BGe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Qa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Qa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=jX(e):e=jX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function XGe(r){var e;if(this._destroyed)return Qa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,VGe(i),this;function i(){r&&(Qa("Stream was destroyed due to an error. Error: %s.",jGe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Qa("Closing the stream..."),e.emit("close")}}function Le(r){var e,i,t;if(!(this instanceof Le))return arguments.length>0?new Le(r):new Le;if(i=MGe({},FGe),arguments.length>0&&(t=WGe(i,r),t))throw t;return Qa("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),MX.call(this,i),TX(this,"_destroyed",!1),Wn(this,"_objectMode",i.objectMode),Wn(this,"_sep",i.sep),Wn(this,"_iter",i.iter),Wn(this,"_siter",i.siter),TX(this,"_i",0),e=AGe(i),i.normalized&&(e=e.normalized),Wn(this,"_prng",e),this}xGe(Le,MX);Sd(Le.prototype,"seed",IGe);Sd(Le.prototype,"seedLength",zGe);GGe(Le.prototype,"state",UGe,CGe);Sd(Le.prototype,"stateLength",kGe);Sd(Le.prototype,"byteLength",JGe);Wn(Le.prototype,"_read",BGe);Wn(Le.prototype,"destroy",XGe);xX.exports=Le});var AX=s(function(QHe,GX){"use strict";var DGe=require("@stdlib/assert/is-plain-object"),YGe=require("@stdlib/object/assign"),HGe=require("@stdlib/string/format"),ZGe=Od();function QGe(r){var e;if(arguments.length>0){if(e=r,!DGe(e))throw new TypeError(HGe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=YGe({},r)}else e={};return e.objectMode=!0,new ZGe(e)}GX.exports=QGe});var FX=s(function($He,VX){"use strict";var $Ge=require("@stdlib/assert/is-plain-object"),KGe=require("@stdlib/object/assign"),eAe=require("@stdlib/string/format"),rAe=Od();function tAe(r){var e;if(arguments.length>0){if(!$Ge(r))throw new TypeError(eAe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=KGe({},r)}else e={};return i;function i(){return new rAe(e)}}VX.exports=tAe});var zX=s(function(KHe,IX){"use strict";var WX=require("@stdlib/utils/define-nonenumerable-read-only-property"),dh=Od(),iAe=AX(),nAe=FX();WX(dh,"objectMode",iAe);WX(dh,"factory",nAe);IX.exports=dh});var kX=s(function(eZe,aAe){aAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var BX=s(function(rZe,CX){"use strict";var sAe=require("@stdlib/assert/is-plain-object"),yr=require("@stdlib/assert/has-own-property"),JX=require("@stdlib/assert/is-boolean").isPrimitive,uAe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,UX=require("@stdlib/assert/is-string").isPrimitive,oAe=require("@stdlib/assert/is-positive-integer").isPrimitive,gAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Wi=require("@stdlib/string/format");function vAe(r,e){return sAe(e)?yr(e,"sep")&&(r.sep=e.sep,!UX(r.sep))?new TypeError(Wi("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):yr(e,"objectMode")&&(r.objectMode=e.objectMode,!JX(r.objectMode))?new TypeError(Wi("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):yr(e,"encoding")&&(r.encoding=e.encoding,!UX(r.encoding)&&r.encoding!==null)?new TypeError(Wi("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):yr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!uAe(r.highWaterMark))?new TypeError(Wi("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):yr(e,"iter")&&(r.iter=e.iter,!gAe(r.iter))?new TypeError(Wi("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):yr(e,"siter")&&(r.siter=e.siter,!oAe(r.siter))?new TypeError(Wi("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):yr(e,"normalized")&&(r.normalized=e.normalized,!JX(r.normalized))?new TypeError(Wi("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(yr(e,"seed")&&(r.seed=e.seed),yr(e,"state")&&(r.state=e.state),yr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Wi("invalid argument. Options argument must be an object. Value: `%s`.",e))}CX.exports=vAe});var DX=s(function(tZe,XX){"use strict";var fAe=require("debug"),dAe=fAe("random:streams:minstd-shuffle");XX.exports=dAe});var Ld=s(function(iZe,QX){"use strict";var ZX=require("readable-stream").Readable,lAe=require("@stdlib/assert/is-error"),cAe=require("@stdlib/object/assign"),mAe=require("@stdlib/utils/inherit"),YX=require("@stdlib/utils/define-nonenumerable-property"),In=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nd=require("@stdlib/utils/define-read-only-accessor"),hAe=require("@stdlib/utils/define-read-write-accessor"),pAe=Q().factory,HX=require("@stdlib/buffer/from-string"),yAe=require("@stdlib/utils/next-tick"),qAe=kX(),bAe=BX(),$a=DX();function wAe(){return this._prng.seed}function SAe(){return this._prng.seedLength}function OAe(){return this._prng.stateLength}function NAe(){return this._prng.byteLength}function LAe(){return this._prng.state}function EAe(r){this._prng.state=r}function RAe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return $a("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),$a("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=HX(e):e=HX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function PAe(r){var e;if(this._destroyed)return $a("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,yAe(i),this;function i(){r&&($a("Stream was destroyed due to an error. Error: %s.",lAe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),$a("Closing the stream..."),e.emit("close")}}function Ee(r){var e,i,t;if(!(this instanceof Ee))return arguments.length>0?new Ee(r):new Ee;if(i=cAe({},qAe),arguments.length>0&&(t=bAe(i,r),t))throw t;return $a("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),ZX.call(this,i),YX(this,"_destroyed",!1),In(this,"_objectMode",i.objectMode),In(this,"_sep",i.sep),In(this,"_iter",i.iter),In(this,"_siter",i.siter),YX(this,"_i",0),e=pAe(i),i.normalized&&(e=e.normalized),In(this,"_prng",e),this}mAe(Ee,ZX);Nd(Ee.prototype,"seed",wAe);Nd(Ee.prototype,"seedLength",SAe);hAe(Ee.prototype,"state",LAe,EAe);Nd(Ee.prototype,"stateLength",OAe);Nd(Ee.prototype,"byteLength",NAe);In(Ee.prototype,"_read",RAe);In(Ee.prototype,"destroy",PAe);QX.exports=Ee});var KX=s(function(nZe,$X){"use strict";var _Ae=require("@stdlib/assert/is-plain-object"),TAe=require("@stdlib/object/assign"),jAe=require("@stdlib/string/format"),MAe=Ld();function xAe(r){var e;if(arguments.length>0){if(e=r,!_Ae(e))throw new TypeError(jAe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=TAe({},r)}else e={};return e.objectMode=!0,new MAe(e)}$X.exports=xAe});var r7=s(function(aZe,e7){"use strict";var GAe=require("@stdlib/assert/is-plain-object"),AAe=require("@stdlib/object/assign"),VAe=require("@stdlib/string/format"),FAe=Ld();function WAe(r){var e;if(arguments.length>0){if(!GAe(r))throw new TypeError(VAe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=AAe({},r)}else e={};return i;function i(){return new FAe(e)}}e7.exports=WAe});var n7=s(function(sZe,i7){"use strict";var t7=require("@stdlib/utils/define-nonenumerable-read-only-property"),lh=Ld(),IAe=KX(),zAe=r7();t7(lh,"objectMode",IAe);t7(lh,"factory",zAe);i7.exports=lh});var a7=s(function(uZe,kAe){kAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var g7=s(function(oZe,o7){"use strict";var JAe=require("@stdlib/assert/is-plain-object"),qr=require("@stdlib/assert/has-own-property"),s7=require("@stdlib/assert/is-boolean").isPrimitive,UAe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,u7=require("@stdlib/assert/is-string").isPrimitive,CAe=require("@stdlib/assert/is-positive-integer").isPrimitive,BAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ii=require("@stdlib/string/format");function XAe(r,e){return JAe(e)?qr(e,"sep")&&(r.sep=e.sep,!u7(r.sep))?new TypeError(Ii("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):qr(e,"objectMode")&&(r.objectMode=e.objectMode,!s7(r.objectMode))?new TypeError(Ii("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):qr(e,"encoding")&&(r.encoding=e.encoding,!u7(r.encoding)&&r.encoding!==null)?new TypeError(Ii("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):qr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!UAe(r.highWaterMark))?new TypeError(Ii("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):qr(e,"iter")&&(r.iter=e.iter,!BAe(r.iter))?new TypeError(Ii("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):qr(e,"siter")&&(r.siter=e.siter,!CAe(r.siter))?new TypeError(Ii("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):qr(e,"normalized")&&(r.normalized=e.normalized,!s7(r.normalized))?new TypeError(Ii("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(qr(e,"seed")&&(r.seed=e.seed),qr(e,"state")&&(r.state=e.state),qr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ii("invalid argument. Options argument must be an object. Value: `%s`.",e))}o7.exports=XAe});var f7=s(function(gZe,v7){"use strict";var DAe=require("debug"),YAe=DAe("random:streams:mt19937");v7.exports=YAe});var Rd=s(function(vZe,m7){"use strict";var c7=require("readable-stream").Readable,HAe=require("@stdlib/assert/is-error"),ZAe=require("@stdlib/object/assign"),QAe=require("@stdlib/utils/inherit"),d7=require("@stdlib/utils/define-nonenumerable-property"),zn=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ed=require("@stdlib/utils/define-read-only-accessor"),$Ae=require("@stdlib/utils/define-read-write-accessor"),KAe=j().factory,l7=require("@stdlib/buffer/from-string"),eVe=require("@stdlib/utils/next-tick"),rVe=a7(),tVe=g7(),Ka=f7();function iVe(){return this._prng.seed}function nVe(){return this._prng.seedLength}function aVe(){return this._prng.stateLength}function sVe(){return this._prng.byteLength}function uVe(){return this._prng.state}function oVe(r){this._prng.state=r}function gVe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ka("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ka("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=l7(e):e=l7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function vVe(r){var e;if(this._destroyed)return Ka("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,eVe(i),this;function i(){r&&(Ka("Stream was destroyed due to an error. Error: %s.",HAe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ka("Closing the stream..."),e.emit("close")}}function Re(r){var e,i,t;if(!(this instanceof Re))return arguments.length>0?new Re(r):new Re;if(i=ZAe({},rVe),arguments.length>0&&(t=tVe(i,r),t))throw t;return Ka("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),c7.call(this,i),d7(this,"_destroyed",!1),zn(this,"_objectMode",i.objectMode),zn(this,"_sep",i.sep),zn(this,"_iter",i.iter),zn(this,"_siter",i.siter),d7(this,"_i",0),e=KAe(i),i.normalized&&(e=e.normalized),zn(this,"_prng",e),this}QAe(Re,c7);Ed(Re.prototype,"seed",iVe);Ed(Re.prototype,"seedLength",nVe);$Ae(Re.prototype,"state",uVe,oVe);Ed(Re.prototype,"stateLength",aVe);Ed(Re.prototype,"byteLength",sVe);zn(Re.prototype,"_read",gVe);zn(Re.prototype,"destroy",vVe);m7.exports=Re});var p7=s(function(fZe,h7){"use strict";var fVe=require("@stdlib/assert/is-plain-object"),dVe=require("@stdlib/object/assign"),lVe=require("@stdlib/string/format"),cVe=Rd();function mVe(r){var e;if(arguments.length>0){if(e=r,!fVe(e))throw new TypeError(lVe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=dVe({},r)}else e={};return e.objectMode=!0,new cVe(e)}h7.exports=mVe});var q7=s(function(dZe,y7){"use strict";var hVe=require("@stdlib/assert/is-plain-object"),pVe=require("@stdlib/object/assign"),yVe=require("@stdlib/string/format"),qVe=Rd();function bVe(r){var e;if(arguments.length>0){if(!hVe(r))throw new TypeError(yVe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=pVe({},r)}else e={};return i;function i(){return new qVe(e)}}y7.exports=bVe});var S7=s(function(lZe,w7){"use strict";var b7=require("@stdlib/utils/define-nonenumerable-read-only-property"),ch=Rd(),wVe=p7(),SVe=q7();b7(ch,"objectMode",wVe);b7(ch,"factory",SVe);w7.exports=ch});var O7=s(function(cZe,OVe){OVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var E7=s(function(mZe,L7){"use strict";var NVe=require("@stdlib/assert/is-plain-object"),br=require("@stdlib/assert/has-own-property"),LVe=require("@stdlib/assert/is-boolean").isPrimitive,EVe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,N7=require("@stdlib/assert/is-string").isPrimitive,RVe=require("@stdlib/assert/is-positive-integer").isPrimitive,PVe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,kn=require("@stdlib/string/format");function _Ve(r,e){return NVe(e)?br(e,"sep")&&(r.sep=e.sep,!N7(r.sep))?new TypeError(kn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):br(e,"objectMode")&&(r.objectMode=e.objectMode,!LVe(r.objectMode))?new TypeError(kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):br(e,"encoding")&&(r.encoding=e.encoding,!N7(r.encoding)&&r.encoding!==null)?new TypeError(kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):br(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!EVe(r.highWaterMark))?new TypeError(kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):br(e,"iter")&&(r.iter=e.iter,!PVe(r.iter))?new TypeError(kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):br(e,"siter")&&(r.siter=e.siter,!RVe(r.siter))?new TypeError(kn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(br(e,"prng")&&(r.prng=e.prng),br(e,"seed")&&(r.seed=e.seed),br(e,"state")&&(r.state=e.state),br(e,"copy")&&(r.copy=e.copy),null):new TypeError(kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}L7.exports=_Ve});var P7=s(function(hZe,R7){"use strict";var TVe=require("debug"),jVe=TVe("random:streams:negative-binomial");R7.exports=jVe});var _d=s(function(pZe,x7){"use strict";var M7=require("readable-stream").Readable,MVe=require("@stdlib/assert/is-positive-number").isPrimitive,xVe=require("@stdlib/assert/is-probability").isPrimitive,GVe=require("@stdlib/assert/is-error"),AVe=require("@stdlib/object/assign"),VVe=require("@stdlib/utils/inherit"),_7=require("@stdlib/utils/define-nonenumerable-property"),zi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pd=require("@stdlib/utils/define-read-only-accessor"),FVe=require("@stdlib/utils/define-read-write-accessor"),WVe=tu().factory,T7=require("@stdlib/buffer/from-string"),IVe=require("@stdlib/utils/next-tick"),j7=require("@stdlib/string/format"),zVe=O7(),kVe=E7(),es=P7();function JVe(){return this._prng.seed}function UVe(){return this._prng.seedLength}function CVe(){return this._prng.stateLength}function BVe(){return this._prng.byteLength}function XVe(){return this._prng.state}function DVe(r){this._prng.state=r}function YVe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return es("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),es("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=T7(e):e=T7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function HVe(r){var e;if(this._destroyed)return es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,IVe(i),this;function i(){r&&(es("Stream was destroyed due to an error. Error: %s.",GVe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),es("Closing the stream..."),e.emit("close")}}function Pe(r,e,i){var t,n;if(!(this instanceof Pe))return arguments.length>2?new Pe(r,e,i):new Pe(r,e);if(!MVe(r))throw new TypeError(j7("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!xVe(e))throw new TypeError(j7("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(t=AVe({},zVe),arguments.length>2&&(n=kVe(t,i),n))throw n;return es("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),M7.call(this,t),_7(this,"_destroyed",!1),zi(this,"_objectMode",t.objectMode),zi(this,"_sep",t.sep),zi(this,"_iter",t.iter),zi(this,"_siter",t.siter),_7(this,"_i",0),zi(this,"_prng",WVe(r,e,t)),zi(this,"PRNG",this._prng.PRNG),this}VVe(Pe,M7);Pd(Pe.prototype,"seed",JVe);Pd(Pe.prototype,"seedLength",UVe);FVe(Pe.prototype,"state",XVe,DVe);Pd(Pe.prototype,"stateLength",CVe);Pd(Pe.prototype,"byteLength",BVe);zi(Pe.prototype,"_read",YVe);zi(Pe.prototype,"destroy",HVe);x7.exports=Pe});var A7=s(function(yZe,G7){"use strict";var ZVe=require("@stdlib/assert/is-plain-object"),QVe=require("@stdlib/object/assign"),$Ve=require("@stdlib/string/format"),KVe=_d();function e2e(r,e,i){var t;if(arguments.length>2){if(t=i,!ZVe(t))throw new TypeError($Ve("invalid argument. Options argument must be an object. Value: `%s`.",t));t=QVe({},i)}else t={};return t.objectMode=!0,new KVe(r,e,t)}G7.exports=e2e});var k7=s(function(qZe,z7){"use strict";var V7=require("@stdlib/assert/is-plain-object"),F7=require("@stdlib/object/assign"),W7=require("@stdlib/string/format"),I7=_d();function r2e(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!V7(r))throw new TypeError(W7("invalid argument. Options argument must be an object. Value: `%s`.",r));n=F7({},r)}else if(t>2){if(!V7(i))throw new TypeError(W7("invalid argument. Options argument must be an object. Value: `%s`.",i));n=F7({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new I7(g,d,n)}function o(){return new I7(r,e,n)}}z7.exports=r2e});var C7=s(function(bZe,U7){"use strict";var J7=require("@stdlib/utils/define-nonenumerable-read-only-property"),mh=_d(),t2e=A7(),i2e=k7();J7(mh,"objectMode",t2e);J7(mh,"factory",i2e);U7.exports=mh});var B7=s(function(wZe,n2e){n2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Y7=s(function(SZe,D7){"use strict";var a2e=require("@stdlib/assert/is-plain-object"),wr=require("@stdlib/assert/has-own-property"),s2e=require("@stdlib/assert/is-boolean").isPrimitive,u2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,X7=require("@stdlib/assert/is-string").isPrimitive,o2e=require("@stdlib/assert/is-positive-integer").isPrimitive,g2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jn=require("@stdlib/string/format");function v2e(r,e){return a2e(e)?wr(e,"sep")&&(r.sep=e.sep,!X7(r.sep))?new TypeError(Jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):wr(e,"objectMode")&&(r.objectMode=e.objectMode,!s2e(r.objectMode))?new TypeError(Jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):wr(e,"encoding")&&(r.encoding=e.encoding,!X7(r.encoding)&&r.encoding!==null)?new TypeError(Jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):wr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!u2e(r.highWaterMark))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):wr(e,"iter")&&(r.iter=e.iter,!g2e(r.iter))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):wr(e,"siter")&&(r.siter=e.siter,!o2e(r.siter))?new TypeError(Jn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(wr(e,"prng")&&(r.prng=e.prng),wr(e,"seed")&&(r.seed=e.seed),wr(e,"state")&&(r.state=e.state),wr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}D7.exports=v2e});var Z7=s(function(OZe,H7){"use strict";var f2e=require("debug"),d2e=f2e("random:streams:normal");H7.exports=d2e});var jd=s(function(NZe,r6){"use strict";var e6=require("readable-stream").Readable,l2e=require("@stdlib/assert/is-positive-number").isPrimitive,c2e=require("@stdlib/assert/is-number").isPrimitive,m2e=require("@stdlib/math/base/assert/is-nan"),h2e=require("@stdlib/assert/is-error"),p2e=require("@stdlib/object/assign"),y2e=require("@stdlib/utils/inherit"),Q7=require("@stdlib/utils/define-nonenumerable-property"),ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),Td=require("@stdlib/utils/define-read-only-accessor"),q2e=require("@stdlib/utils/define-read-write-accessor"),b2e=gn().factory,$7=require("@stdlib/buffer/from-string"),w2e=require("@stdlib/utils/next-tick"),K7=require("@stdlib/string/format"),S2e=B7(),O2e=Y7(),rs=Z7();function N2e(){return this._prng.seed}function L2e(){return this._prng.seedLength}function E2e(){return this._prng.stateLength}function R2e(){return this._prng.byteLength}function P2e(){return this._prng.state}function _2e(r){this._prng.state=r}function T2e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return rs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),rs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=$7(e):e=$7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function j2e(r){var e;if(this._destroyed)return rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,w2e(i),this;function i(){r&&(rs("Stream was destroyed due to an error. Error: %s.",h2e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),rs("Closing the stream..."),e.emit("close")}}function _e(r,e,i){var t,n;if(!(this instanceof _e))return arguments.length>2?new _e(r,e,i):new _e(r,e);if(!c2e(r)||m2e(r))throw new TypeError(K7("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!l2e(e))throw new TypeError(K7("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=p2e({},S2e),arguments.length>2&&(n=O2e(t,i),n))throw n;return rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),e6.call(this,t),Q7(this,"_destroyed",!1),ki(this,"_objectMode",t.objectMode),ki(this,"_sep",t.sep),ki(this,"_iter",t.iter),ki(this,"_siter",t.siter),Q7(this,"_i",0),ki(this,"_prng",b2e(r,e,t)),ki(this,"PRNG",this._prng.PRNG),this}y2e(_e,e6);Td(_e.prototype,"seed",N2e);Td(_e.prototype,"seedLength",L2e);q2e(_e.prototype,"state",P2e,_2e);Td(_e.prototype,"stateLength",E2e);Td(_e.prototype,"byteLength",R2e);ki(_e.prototype,"_read",T2e);ki(_e.prototype,"destroy",j2e);r6.exports=_e});var i6=s(function(LZe,t6){"use strict";var M2e=require("@stdlib/assert/is-plain-object"),x2e=require("@stdlib/object/assign"),G2e=require("@stdlib/string/format"),A2e=jd();function V2e(r,e,i){var t;if(arguments.length>2){if(t=i,!M2e(t))throw new TypeError(G2e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=x2e({},i)}else t={};return t.objectMode=!0,new A2e(r,e,t)}t6.exports=V2e});var g6=s(function(EZe,o6){"use strict";var n6=require("@stdlib/assert/is-plain-object"),a6=require("@stdlib/object/assign"),s6=require("@stdlib/string/format"),u6=jd();function F2e(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!n6(r))throw new TypeError(s6("invalid argument. Options argument must be an object. Value: `%s`.",r));n=a6({},r)}else if(t>2){if(!n6(i))throw new TypeError(s6("invalid argument. Options argument must be an object. Value: `%s`.",i));n=a6({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new u6(g,d,n)}function o(){return new u6(r,e,n)}}o6.exports=F2e});var d6=s(function(RZe,f6){"use strict";var v6=require("@stdlib/utils/define-nonenumerable-read-only-property"),hh=jd(),W2e=i6(),I2e=g6();v6(hh,"objectMode",W2e);v6(hh,"factory",I2e);f6.exports=hh});var l6=s(function(PZe,z2e){z2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var h6=s(function(_Ze,m6){"use strict";var k2e=require("@stdlib/assert/is-plain-object"),Sr=require("@stdlib/assert/has-own-property"),J2e=require("@stdlib/assert/is-boolean").isPrimitive,U2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,c6=require("@stdlib/assert/is-string").isPrimitive,C2e=require("@stdlib/assert/is-positive-integer").isPrimitive,B2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Un=require("@stdlib/string/format");function X2e(r,e){return k2e(e)?Sr(e,"sep")&&(r.sep=e.sep,!c6(r.sep))?new TypeError(Un("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Sr(e,"objectMode")&&(r.objectMode=e.objectMode,!J2e(r.objectMode))?new TypeError(Un("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Sr(e,"encoding")&&(r.encoding=e.encoding,!c6(r.encoding)&&r.encoding!==null)?new TypeError(Un("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Sr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!U2e(r.highWaterMark))?new TypeError(Un("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Sr(e,"iter")&&(r.iter=e.iter,!B2e(r.iter))?new TypeError(Un("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Sr(e,"siter")&&(r.siter=e.siter,!C2e(r.siter))?new TypeError(Un("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Sr(e,"prng")&&(r.prng=e.prng),Sr(e,"seed")&&(r.seed=e.seed),Sr(e,"state")&&(r.state=e.state),Sr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Un("invalid argument. Options argument must be an object. Value: `%s`.",e))}m6.exports=X2e});var y6=s(function(TZe,p6){"use strict";var D2e=require("debug"),Y2e=D2e("random:streams:pareto1");p6.exports=Y2e});var xd=s(function(jZe,N6){"use strict";var O6=require("readable-stream").Readable,q6=require("@stdlib/assert/is-positive-number").isPrimitive,H2e=require("@stdlib/assert/is-error"),Z2e=require("@stdlib/object/assign"),Q2e=require("@stdlib/utils/inherit"),b6=require("@stdlib/utils/define-nonenumerable-property"),Ji=require("@stdlib/utils/define-nonenumerable-read-only-property"),Md=require("@stdlib/utils/define-read-only-accessor"),$2e=require("@stdlib/utils/define-read-write-accessor"),K2e=iu().factory,w6=require("@stdlib/buffer/from-string"),eFe=require("@stdlib/utils/next-tick"),S6=require("@stdlib/string/format"),rFe=l6(),tFe=h6(),ts=y6();function iFe(){return this._prng.seed}function nFe(){return this._prng.seedLength}function aFe(){return this._prng.stateLength}function sFe(){return this._prng.byteLength}function uFe(){return this._prng.state}function oFe(r){this._prng.state=r}function gFe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ts("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ts("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=w6(e):e=w6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function vFe(r){var e;if(this._destroyed)return ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,eFe(i),this;function i(){r&&(ts("Stream was destroyed due to an error. Error: %s.",H2e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ts("Closing the stream..."),e.emit("close")}}function Te(r,e,i){var t,n;if(!(this instanceof Te))return arguments.length>2?new Te(r,e,i):new Te(r,e);if(!q6(r))throw new TypeError(S6("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!q6(e))throw new TypeError(S6("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=Z2e({},rFe),arguments.length>2&&(n=tFe(t,i),n))throw n;return ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),O6.call(this,t),b6(this,"_destroyed",!1),Ji(this,"_objectMode",t.objectMode),Ji(this,"_sep",t.sep),Ji(this,"_iter",t.iter),Ji(this,"_siter",t.siter),b6(this,"_i",0),Ji(this,"_prng",K2e(r,e,t)),Ji(this,"PRNG",this._prng.PRNG),this}Q2e(Te,O6);Md(Te.prototype,"seed",iFe);Md(Te.prototype,"seedLength",nFe);$2e(Te.prototype,"state",uFe,oFe);Md(Te.prototype,"stateLength",aFe);Md(Te.prototype,"byteLength",sFe);Ji(Te.prototype,"_read",gFe);Ji(Te.prototype,"destroy",vFe);N6.exports=Te});var E6=s(function(MZe,L6){"use strict";var fFe=require("@stdlib/assert/is-plain-object"),dFe=require("@stdlib/object/assign"),lFe=require("@stdlib/string/format"),cFe=xd();function mFe(r,e,i){var t;if(arguments.length>2){if(t=i,!fFe(t))throw new TypeError(lFe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=dFe({},i)}else t={};return t.objectMode=!0,new cFe(r,e,t)}L6.exports=mFe});var M6=s(function(xZe,j6){"use strict";var R6=require("@stdlib/assert/is-plain-object"),P6=require("@stdlib/object/assign"),_6=require("@stdlib/string/format"),T6=xd();function hFe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!R6(r))throw new TypeError(_6("invalid argument. Options argument must be an object. Value: `%s`.",r));n=P6({},r)}else if(t>2){if(!R6(i))throw new TypeError(_6("invalid argument. Options argument must be an object. Value: `%s`.",i));n=P6({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new T6(g,d,n)}function o(){return new T6(r,e,n)}}j6.exports=hFe});var A6=s(function(GZe,G6){"use strict";var x6=require("@stdlib/utils/define-nonenumerable-read-only-property"),ph=xd(),pFe=E6(),yFe=M6();x6(ph,"objectMode",pFe);x6(ph,"factory",yFe);G6.exports=ph});var V6=s(function(AZe,qFe){qFe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var I6=s(function(VZe,W6){"use strict";var bFe=require("@stdlib/assert/is-plain-object"),Or=require("@stdlib/assert/has-own-property"),wFe=require("@stdlib/assert/is-boolean").isPrimitive,SFe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,F6=require("@stdlib/assert/is-string").isPrimitive,OFe=require("@stdlib/assert/is-positive-integer").isPrimitive,NFe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Cn=require("@stdlib/string/format");function LFe(r,e){return bFe(e)?Or(e,"sep")&&(r.sep=e.sep,!F6(r.sep))?new TypeError(Cn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Or(e,"objectMode")&&(r.objectMode=e.objectMode,!wFe(r.objectMode))?new TypeError(Cn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Or(e,"encoding")&&(r.encoding=e.encoding,!F6(r.encoding)&&r.encoding!==null)?new TypeError(Cn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!SFe(r.highWaterMark))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Or(e,"iter")&&(r.iter=e.iter,!NFe(r.iter))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Or(e,"siter")&&(r.siter=e.siter,!OFe(r.siter))?new TypeError(Cn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Or(e,"prng")&&(r.prng=e.prng),Or(e,"seed")&&(r.seed=e.seed),Or(e,"state")&&(r.state=e.state),Or(e,"copy")&&(r.copy=e.copy),null):new TypeError(Cn("invalid argument. Options argument must be an object. Value: `%s`.",e))}W6.exports=LFe});var k6=s(function(FZe,z6){"use strict";var EFe=require("debug"),RFe=EFe("random:streams:poisson");z6.exports=RFe});var Ad=s(function(WZe,B6){"use strict";var C6=require("readable-stream").Readable,PFe=require("@stdlib/assert/is-positive-number").isPrimitive,_Fe=require("@stdlib/assert/is-error"),TFe=require("@stdlib/object/assign"),jFe=require("@stdlib/utils/inherit"),J6=require("@stdlib/utils/define-nonenumerable-property"),Ui=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gd=require("@stdlib/utils/define-read-only-accessor"),MFe=require("@stdlib/utils/define-read-write-accessor"),xFe=pa().factory,U6=require("@stdlib/buffer/from-string"),GFe=require("@stdlib/string/format"),AFe=require("@stdlib/utils/next-tick"),VFe=V6(),FFe=I6(),is=k6();function WFe(){return this._prng.seed}function IFe(){return this._prng.seedLength}function zFe(){return this._prng.stateLength}function kFe(){return this._prng.byteLength}function JFe(){return this._prng.state}function UFe(r){this._prng.state=r}function CFe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return is("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),is("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=U6(e):e=U6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function BFe(r){var e;if(this._destroyed)return is("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,AFe(i),this;function i(){r&&(is("Stream was destroyed due to an error. Error: %s.",_Fe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),is("Closing the stream..."),e.emit("close")}}function je(r,e){var i,t;if(!(this instanceof je))return arguments.length>1?new je(r,e):new je(r);if(!PFe(r))throw new TypeError(GFe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=TFe({},VFe),arguments.length>1&&(t=FFe(i,e),t))throw t;return is("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),C6.call(this,i),J6(this,"_destroyed",!1),Ui(this,"_objectMode",i.objectMode),Ui(this,"_sep",i.sep),Ui(this,"_iter",i.iter),Ui(this,"_siter",i.siter),J6(this,"_i",0),Ui(this,"_prng",xFe(r,i)),Ui(this,"PRNG",this._prng.PRNG),this}jFe(je,C6);Gd(je.prototype,"seed",WFe);Gd(je.prototype,"seedLength",IFe);MFe(je.prototype,"state",JFe,UFe);Gd(je.prototype,"stateLength",zFe);Gd(je.prototype,"byteLength",kFe);Ui(je.prototype,"_read",CFe);Ui(je.prototype,"destroy",BFe);B6.exports=je});var D6=s(function(IZe,X6){"use strict";var XFe=require("@stdlib/assert/is-plain-object"),DFe=require("@stdlib/object/assign"),YFe=require("@stdlib/string/format"),HFe=Ad();function ZFe(r,e){var i;if(arguments.length>1){if(i=e,!XFe(i))throw new TypeError(YFe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=DFe({},e)}else i={};return i.objectMode=!0,new HFe(r,i)}X6.exports=ZFe});var K6=s(function(zZe,$6){"use strict";var QFe=require("@stdlib/assert/is-positive-number").isPrimitive,Y6=require("@stdlib/assert/is-plain-object"),H6=require("@stdlib/object/assign"),Z6=require("@stdlib/string/format"),Q6=Ad();function $Fe(r,e){var i,t,n;if(i=arguments.length,i>1){if(!Y6(e))throw new TypeError(Z6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=H6({},e)}else if(i===1)if(QFe(r))n=u,t={};else{if(!Y6(r))throw new TypeError(Z6("invalid argument. Options argument must be an object. Value: `%s`.",r));t=H6({},r),n=a}else t={},n=a;return n;function a(o){return new Q6(o,t)}function u(){return new Q6(r,t)}}$6.exports=$Fe});var tD=s(function(kZe,rD){"use strict";var eD=require("@stdlib/utils/define-nonenumerable-read-only-property"),yh=Ad(),KFe=D6(),eWe=K6();eD(yh,"objectMode",KFe);eD(yh,"factory",eWe);rD.exports=yh});var iD=s(function(JZe,rWe){rWe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var sD=s(function(UZe,aD){"use strict";var tWe=require("@stdlib/assert/is-plain-object"),Nr=require("@stdlib/assert/has-own-property"),iWe=require("@stdlib/assert/is-boolean").isPrimitive,nWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,nD=require("@stdlib/assert/is-string").isPrimitive,aWe=require("@stdlib/assert/is-positive-integer").isPrimitive,sWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Bn=require("@stdlib/string/format");function uWe(r,e){return tWe(e)?Nr(e,"sep")&&(r.sep=e.sep,!nD(r.sep))?new TypeError(Bn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Nr(e,"objectMode")&&(r.objectMode=e.objectMode,!iWe(r.objectMode))?new TypeError(Bn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Nr(e,"encoding")&&(r.encoding=e.encoding,!nD(r.encoding)&&r.encoding!==null)?new TypeError(Bn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!nWe(r.highWaterMark))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Nr(e,"iter")&&(r.iter=e.iter,!sWe(r.iter))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Nr(e,"siter")&&(r.siter=e.siter,!aWe(r.siter))?new TypeError(Bn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Nr(e,"name")&&(r.name=e.name),Nr(e,"seed")&&(r.seed=e.seed),Nr(e,"state")&&(r.state=e.state),Nr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Bn("invalid argument. Options argument must be an object. Value: `%s`.",e))}aD.exports=uWe});var oD=s(function(CZe,uD){"use strict";var oWe=require("debug"),gWe=oWe("random:streams:randi");uD.exports=gWe});var Fd=s(function(BZe,dD){"use strict";var fD=require("readable-stream").Readable,vWe=require("@stdlib/assert/is-error"),fWe=require("@stdlib/object/assign"),dWe=require("@stdlib/utils/inherit"),gD=require("@stdlib/utils/define-nonenumerable-property"),Ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vd=require("@stdlib/utils/define-read-only-accessor"),lWe=require("@stdlib/utils/define-read-write-accessor"),cWe=su().factory,vD=require("@stdlib/buffer/from-string"),mWe=require("@stdlib/utils/next-tick"),hWe=iD(),pWe=sD(),ns=oD();function yWe(){return this._prng.seed}function qWe(){return this._prng.seedLength}function bWe(){return this._prng.stateLength}function wWe(){return this._prng.byteLength}function SWe(){return this._prng.state}function OWe(r){this._prng.state=r}function NWe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ns("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ns("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=vD(e):e=vD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function LWe(r){var e;if(this._destroyed)return ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,mWe(i),this;function i(){r&&(ns("Stream was destroyed due to an error. Error: %s.",vWe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ns("Closing the stream..."),e.emit("close")}}function Me(r){var e,i;if(!(this instanceof Me))return arguments.length>0?new Me(r):new Me;if(e=fWe({},hWe),arguments.length>0&&(i=pWe(e,r),i))throw i;return ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),fD.call(this,e),gD(this,"_destroyed",!1),Ci(this,"_objectMode",e.objectMode),Ci(this,"_sep",e.sep),Ci(this,"_iter",e.iter),Ci(this,"_siter",e.siter),gD(this,"_i",0),Ci(this,"_prng",cWe(e)),Ci(this,"PRNG",this._prng.PRNG),this}dWe(Me,fD);Vd(Me.prototype,"seed",yWe);Vd(Me.prototype,"seedLength",qWe);lWe(Me.prototype,"state",SWe,OWe);Vd(Me.prototype,"stateLength",bWe);Vd(Me.prototype,"byteLength",wWe);Ci(Me.prototype,"_read",NWe);Ci(Me.prototype,"destroy",LWe);dD.exports=Me});var cD=s(function(XZe,lD){"use strict";var EWe=require("@stdlib/assert/is-plain-object"),RWe=require("@stdlib/object/assign"),PWe=require("@stdlib/string/format"),_We=Fd();function TWe(r){var e;if(arguments.length>0){if(e=r,!EWe(e))throw new TypeError(PWe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=RWe({},r)}else e={};return e.objectMode=!0,new _We(e)}lD.exports=TWe});var hD=s(function(DZe,mD){"use strict";var jWe=require("@stdlib/assert/is-plain-object"),MWe=require("@stdlib/object/assign"),xWe=require("@stdlib/string/format"),GWe=Fd();function AWe(r){var e;if(arguments.length>0){if(!jWe(r))throw new TypeError(xWe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=MWe({},r)}else e={};return i;function i(){return new GWe(e)}}mD.exports=AWe});var qD=s(function(YZe,yD){"use strict";var pD=require("@stdlib/utils/define-nonenumerable-read-only-property"),qh=Fd(),VWe=cD(),FWe=hD();pD(qh,"objectMode",VWe);pD(qh,"factory",FWe);yD.exports=qh});var bD=s(function(HZe,WWe){WWe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"improved-ziggurat"}});var OD=s(function(ZZe,SD){"use strict";var IWe=require("@stdlib/assert/is-plain-object"),Je=require("@stdlib/assert/has-own-property"),zWe=require("@stdlib/assert/is-boolean").isPrimitive,kWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,wD=require("@stdlib/assert/is-string").isPrimitive,JWe=require("@stdlib/assert/is-positive-integer").isPrimitive,UWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Xn=require("@stdlib/string/format");function CWe(r,e){return IWe(e)?Je(e,"sep")&&(r.sep=e.sep,!wD(r.sep))?new TypeError(Xn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Je(e,"objectMode")&&(r.objectMode=e.objectMode,!zWe(r.objectMode))?new TypeError(Xn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Je(e,"encoding")&&(r.encoding=e.encoding,!wD(r.encoding)&&r.encoding!==null)?new TypeError(Xn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Je(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!kWe(r.highWaterMark))?new TypeError(Xn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Je(e,"iter")&&(r.iter=e.iter,!UWe(r.iter))?new TypeError(Xn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Je(e,"siter")&&(r.siter=e.siter,!JWe(r.siter))?new TypeError(Xn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Je(e,"name")&&(r.name=e.name),Je(e,"prng")&&(r.prng=e.prng),Je(e,"seed")&&(r.seed=e.seed),Je(e,"state")&&(r.state=e.state),Je(e,"copy")&&(r.copy=e.copy),null):new TypeError(Xn("invalid argument. Options argument must be an object. Value: `%s`.",e))}SD.exports=CWe});var LD=s(function(QZe,ND){"use strict";var BWe=require("debug"),XWe=BWe("random:streams:randn");ND.exports=XWe});var Id=s(function($Ze,_D){"use strict";var PD=require("readable-stream").Readable,DWe=require("@stdlib/assert/is-error"),YWe=require("@stdlib/object/assign"),HWe=require("@stdlib/utils/inherit"),ED=require("@stdlib/utils/define-nonenumerable-property"),Bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wd=require("@stdlib/utils/define-read-only-accessor"),ZWe=require("@stdlib/utils/define-read-write-accessor"),QWe=ou().factory,RD=require("@stdlib/buffer/from-string"),$We=require("@stdlib/utils/next-tick"),KWe=bD(),eIe=OD(),as=LD();function rIe(){return this._prng.seed}function tIe(){return this._prng.seedLength}function iIe(){return this._prng.stateLength}function nIe(){return this._prng.byteLength}function aIe(){return this._prng.state}function sIe(r){this._prng.state=r}function uIe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return as("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),as("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=RD(e):e=RD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function oIe(r){var e;if(this._destroyed)return as("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,$We(i),this;function i(){r&&(as("Stream was destroyed due to an error. Error: %s.",DWe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),as("Closing the stream..."),e.emit("close")}}function xe(r){var e,i;if(!(this instanceof xe))return arguments.length>0?new xe(r):new xe;if(e=YWe({},KWe),arguments.length>0&&(i=eIe(e,r),i))throw i;return as("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),PD.call(this,e),ED(this,"_destroyed",!1),Bi(this,"_objectMode",e.objectMode),Bi(this,"_sep",e.sep),Bi(this,"_iter",e.iter),Bi(this,"_siter",e.siter),ED(this,"_i",0),Bi(this,"_prng",QWe(e)),Bi(this,"PRNG",this._prng.PRNG),this}HWe(xe,PD);Wd(xe.prototype,"seed",rIe);Wd(xe.prototype,"seedLength",tIe);ZWe(xe.prototype,"state",aIe,sIe);Wd(xe.prototype,"stateLength",iIe);Wd(xe.prototype,"byteLength",nIe);Bi(xe.prototype,"_read",uIe);Bi(xe.prototype,"destroy",oIe);_D.exports=xe});var jD=s(function(KZe,TD){"use strict";var gIe=require("@stdlib/assert/is-plain-object"),vIe=require("@stdlib/object/assign"),fIe=require("@stdlib/string/format"),dIe=Id();function lIe(r){var e;if(arguments.length>0){if(e=r,!gIe(e))throw new TypeError(fIe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=vIe({},r)}else e={};return e.objectMode=!0,new dIe(e)}TD.exports=lIe});var xD=s(function(eQe,MD){"use strict";var cIe=require("@stdlib/assert/is-plain-object"),mIe=require("@stdlib/object/assign"),hIe=require("@stdlib/string/format"),pIe=Id();function yIe(r){var e;if(arguments.length>0){if(!cIe(r))throw new TypeError(hIe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=mIe({},r)}else e={};return i;function i(){return new pIe(e)}}MD.exports=yIe});var VD=s(function(rQe,AD){"use strict";var GD=require("@stdlib/utils/define-nonenumerable-read-only-property"),bh=Id(),qIe=jD(),bIe=xD();GD(bh,"objectMode",qIe);GD(bh,"factory",bIe);AD.exports=bh});var FD=s(function(tQe,wIe){wIe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var zD=s(function(iQe,ID){"use strict";var SIe=require("@stdlib/assert/is-plain-object"),Lr=require("@stdlib/assert/has-own-property"),OIe=require("@stdlib/assert/is-boolean").isPrimitive,NIe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,WD=require("@stdlib/assert/is-string").isPrimitive,LIe=require("@stdlib/assert/is-positive-integer").isPrimitive,EIe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Dn=require("@stdlib/string/format");function RIe(r,e){return SIe(e)?Lr(e,"sep")&&(r.sep=e.sep,!WD(r.sep))?new TypeError(Dn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Lr(e,"objectMode")&&(r.objectMode=e.objectMode,!OIe(r.objectMode))?new TypeError(Dn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Lr(e,"encoding")&&(r.encoding=e.encoding,!WD(r.encoding)&&r.encoding!==null)?new TypeError(Dn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!NIe(r.highWaterMark))?new TypeError(Dn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Lr(e,"iter")&&(r.iter=e.iter,!EIe(r.iter))?new TypeError(Dn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Lr(e,"siter")&&(r.siter=e.siter,!LIe(r.siter))?new TypeError(Dn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Lr(e,"name")&&(r.name=e.name),Lr(e,"seed")&&(r.seed=e.seed),Lr(e,"state")&&(r.state=e.state),Lr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Dn("invalid argument. Options argument must be an object. Value: `%s`.",e))}ID.exports=RIe});var JD=s(function(nQe,kD){"use strict";var PIe=require("debug"),_Ie=PIe("random:streams:randu");kD.exports=_Ie});var kd=s(function(aQe,XD){"use strict";var BD=require("readable-stream").Readable,TIe=require("@stdlib/assert/is-error"),jIe=require("@stdlib/object/assign"),MIe=require("@stdlib/utils/inherit"),UD=require("@stdlib/utils/define-nonenumerable-property"),Xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),zd=require("@stdlib/utils/define-read-only-accessor"),xIe=require("@stdlib/utils/define-read-write-accessor"),GIe=qt().factory,CD=require("@stdlib/buffer/from-string"),AIe=require("@stdlib/utils/next-tick"),VIe=FD(),FIe=zD(),ss=JD();function WIe(){return this._prng.seed}function IIe(){return this._prng.seedLength}function zIe(){return this._prng.stateLength}function kIe(){return this._prng.byteLength}function JIe(){return this._prng.state}function UIe(r){this._prng.state=r}function CIe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ss("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ss("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=CD(e):e=CD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function BIe(r){var e;if(this._destroyed)return ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,AIe(i),this;function i(){r&&(ss("Stream was destroyed due to an error. Error: %s.",TIe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ss("Closing the stream..."),e.emit("close")}}function Ge(r){var e,i;if(!(this instanceof Ge))return arguments.length>0?new Ge(r):new Ge;if(e=jIe({},VIe),arguments.length>0&&(i=FIe(e,r),i))throw i;return ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),BD.call(this,e),UD(this,"_destroyed",!1),Xi(this,"_objectMode",e.objectMode),Xi(this,"_sep",e.sep),Xi(this,"_iter",e.iter),Xi(this,"_siter",e.siter),UD(this,"_i",0),Xi(this,"_prng",GIe(e)),Xi(this,"PRNG",this._prng.PRNG),this}MIe(Ge,BD);zd(Ge.prototype,"seed",WIe);zd(Ge.prototype,"seedLength",IIe);xIe(Ge.prototype,"state",JIe,UIe);zd(Ge.prototype,"stateLength",zIe);zd(Ge.prototype,"byteLength",kIe);Xi(Ge.prototype,"_read",CIe);Xi(Ge.prototype,"destroy",BIe);XD.exports=Ge});var YD=s(function(sQe,DD){"use strict";var XIe=require("@stdlib/assert/is-plain-object"),DIe=require("@stdlib/object/assign"),YIe=require("@stdlib/string/format"),HIe=kd();function ZIe(r){var e;if(arguments.length>0){if(e=r,!XIe(e))throw new TypeError(YIe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=DIe({},r)}else e={};return e.objectMode=!0,new HIe(e)}DD.exports=ZIe});var ZD=s(function(uQe,HD){"use strict";var QIe=require("@stdlib/assert/is-plain-object"),$Ie=require("@stdlib/object/assign"),KIe=require("@stdlib/string/format"),eze=kd();function rze(r){var e;if(arguments.length>0){if(!QIe(r))throw new TypeError(KIe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=$Ie({},r)}else e={};return i;function i(){return new eze(e)}}HD.exports=rze});var KD=s(function(oQe,$D){"use strict";var QD=require("@stdlib/utils/define-nonenumerable-read-only-property"),wh=kd(),tze=YD(),ize=ZD();QD(wh,"objectMode",tze);QD(wh,"factory",ize);$D.exports=wh});var e5=s(function(gQe,nze){nze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var i5=s(function(vQe,t5){"use strict";var aze=require("@stdlib/assert/is-plain-object"),Er=require("@stdlib/assert/has-own-property"),sze=require("@stdlib/assert/is-boolean").isPrimitive,uze=require("@stdlib/assert/is-nonnegative-number").isPrimitive,r5=require("@stdlib/assert/is-string").isPrimitive,oze=require("@stdlib/assert/is-positive-integer").isPrimitive,gze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Yn=require("@stdlib/string/format");function vze(r,e){return aze(e)?Er(e,"sep")&&(r.sep=e.sep,!r5(r.sep))?new TypeError(Yn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Er(e,"objectMode")&&(r.objectMode=e.objectMode,!sze(r.objectMode))?new TypeError(Yn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Er(e,"encoding")&&(r.encoding=e.encoding,!r5(r.encoding)&&r.encoding!==null)?new TypeError(Yn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!uze(r.highWaterMark))?new TypeError(Yn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Er(e,"iter")&&(r.iter=e.iter,!gze(r.iter))?new TypeError(Yn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Er(e,"siter")&&(r.siter=e.siter,!oze(r.siter))?new TypeError(Yn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Er(e,"prng")&&(r.prng=e.prng),Er(e,"seed")&&(r.seed=e.seed),Er(e,"state")&&(r.state=e.state),Er(e,"copy")&&(r.copy=e.copy),null):new TypeError(Yn("invalid argument. Options argument must be an object. Value: `%s`.",e))}t5.exports=vze});var a5=s(function(fQe,n5){"use strict";var fze=require("debug"),dze=fze("random:streams:rayleigh");n5.exports=dze});var Ud=s(function(dQe,g5){"use strict";var o5=require("readable-stream").Readable,lze=require("@stdlib/assert/is-positive-number").isPrimitive,cze=require("@stdlib/assert/is-error"),mze=require("@stdlib/object/assign"),hze=require("@stdlib/utils/inherit"),s5=require("@stdlib/utils/define-nonenumerable-property"),Di=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jd=require("@stdlib/utils/define-read-only-accessor"),pze=require("@stdlib/utils/define-read-write-accessor"),yze=gu().factory,u5=require("@stdlib/buffer/from-string"),qze=require("@stdlib/utils/next-tick"),bze=require("@stdlib/string/format"),wze=e5(),Sze=i5(),us=a5();function Oze(){return this._prng.seed}function Nze(){return this._prng.seedLength}function Lze(){return this._prng.stateLength}function Eze(){return this._prng.byteLength}function Rze(){return this._prng.state}function Pze(r){this._prng.state=r}function _ze(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return us("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),us("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=u5(e):e=u5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Tze(r){var e;if(this._destroyed)return us("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,qze(i),this;function i(){r&&(us("Stream was destroyed due to an error. Error: %s.",cze(r)?r.message:JSON.stringify(r)),e.emit("error",r)),us("Closing the stream..."),e.emit("close")}}function Ae(r,e){var i,t;if(!(this instanceof Ae))return arguments.length>1?new Ae(r,e):new Ae(r);if(!lze(r))throw new TypeError(bze("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=mze({},wze),arguments.length>1&&(t=Sze(i,e),t))throw t;return us("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),o5.call(this,i),s5(this,"_destroyed",!1),Di(this,"_objectMode",i.objectMode),Di(this,"_sep",i.sep),Di(this,"_iter",i.iter),Di(this,"_siter",i.siter),s5(this,"_i",0),Di(this,"_prng",yze(r,i)),Di(this,"PRNG",this._prng.PRNG),this}hze(Ae,o5);Jd(Ae.prototype,"seed",Oze);Jd(Ae.prototype,"seedLength",Nze);pze(Ae.prototype,"state",Rze,Pze);Jd(Ae.prototype,"stateLength",Lze);Jd(Ae.prototype,"byteLength",Eze);Di(Ae.prototype,"_read",_ze);Di(Ae.prototype,"destroy",Tze);g5.exports=Ae});var f5=s(function(lQe,v5){"use strict";var jze=require("@stdlib/assert/is-plain-object"),Mze=require("@stdlib/object/assign"),xze=require("@stdlib/string/format"),Gze=Ud();function Aze(r,e){var i;if(arguments.length>1){if(i=e,!jze(i))throw new TypeError(xze("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Mze({},e)}else i={};return i.objectMode=!0,new Gze(r,i)}v5.exports=Aze});var p5=s(function(cQe,h5){"use strict";var Vze=require("@stdlib/assert/is-positive-number").isPrimitive,d5=require("@stdlib/assert/is-plain-object"),l5=require("@stdlib/object/assign"),c5=require("@stdlib/string/format"),m5=Ud();function Fze(r,e){var i,t,n;if(i=arguments.length,i>1){if(!d5(e))throw new TypeError(c5("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=l5({},e)}else if(i===1)if(Vze(r))n=u,t={};else{if(!d5(r))throw new TypeError(c5("invalid argument. Options argument must be an object. Value: `%s`.",r));t=l5({},r),n=a}else t={},n=a;return n;function a(o){return new m5(o,t)}function u(){return new m5(r,t)}}h5.exports=Fze});var b5=s(function(mQe,q5){"use strict";var y5=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sh=Ud(),Wze=f5(),Ize=p5();y5(Sh,"objectMode",Wze);y5(Sh,"factory",Ize);q5.exports=Sh});var w5=s(function(hQe,zze){zze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var N5=s(function(pQe,O5){"use strict";var kze=require("@stdlib/assert/is-plain-object"),Rr=require("@stdlib/assert/has-own-property"),Jze=require("@stdlib/assert/is-boolean").isPrimitive,Uze=require("@stdlib/assert/is-nonnegative-number").isPrimitive,S5=require("@stdlib/assert/is-string").isPrimitive,Cze=require("@stdlib/assert/is-positive-integer").isPrimitive,Bze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Hn=require("@stdlib/string/format");function Xze(r,e){return kze(e)?Rr(e,"sep")&&(r.sep=e.sep,!S5(r.sep))?new TypeError(Hn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Rr(e,"objectMode")&&(r.objectMode=e.objectMode,!Jze(r.objectMode))?new TypeError(Hn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Rr(e,"encoding")&&(r.encoding=e.encoding,!S5(r.encoding)&&r.encoding!==null)?new TypeError(Hn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Uze(r.highWaterMark))?new TypeError(Hn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Rr(e,"iter")&&(r.iter=e.iter,!Bze(r.iter))?new TypeError(Hn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Rr(e,"siter")&&(r.siter=e.siter,!Cze(r.siter))?new TypeError(Hn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Rr(e,"prng")&&(r.prng=e.prng),Rr(e,"seed")&&(r.seed=e.seed),Rr(e,"state")&&(r.state=e.state),Rr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Hn("invalid argument. Options argument must be an object. Value: `%s`.",e))}O5.exports=Xze});var E5=s(function(yQe,L5){"use strict";var Dze=require("debug"),Yze=Dze("random:streams:t");L5.exports=Yze});var Bd=s(function(qQe,T5){"use strict";var _5=require("readable-stream").Readable,Hze=require("@stdlib/assert/is-positive-number").isPrimitive,Zze=require("@stdlib/assert/is-error"),Qze=require("@stdlib/object/assign"),$ze=require("@stdlib/utils/inherit"),R5=require("@stdlib/utils/define-nonenumerable-property"),Yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cd=require("@stdlib/utils/define-read-only-accessor"),Kze=require("@stdlib/utils/define-read-write-accessor"),eke=vu().factory,P5=require("@stdlib/buffer/from-string"),rke=require("@stdlib/utils/next-tick"),tke=require("@stdlib/string/format"),ike=w5(),nke=N5(),os=E5();function ake(){return this._prng.seed}function ske(){return this._prng.seedLength}function uke(){return this._prng.stateLength}function oke(){return this._prng.byteLength}function gke(){return this._prng.state}function vke(r){this._prng.state=r}function fke(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return os("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),os("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=P5(e):e=P5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function dke(r){var e;if(this._destroyed)return os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rke(i),this;function i(){r&&(os("Stream was destroyed due to an error. Error: %s.",Zze(r)?r.message:JSON.stringify(r)),e.emit("error",r)),os("Closing the stream..."),e.emit("close")}}function Ve(r,e){var i,t;if(!(this instanceof Ve))return arguments.length>1?new Ve(r,e):new Ve(r);if(!Hze(r))throw new TypeError(tke("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=Qze({},ike),arguments.length>1&&(t=nke(i,e),t))throw t;return os("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),_5.call(this,i),R5(this,"_destroyed",!1),Yi(this,"_objectMode",i.objectMode),Yi(this,"_sep",i.sep),Yi(this,"_iter",i.iter),Yi(this,"_siter",i.siter),R5(this,"_i",0),Yi(this,"_prng",eke(r,i)),Yi(this,"PRNG",this._prng.PRNG),this}$ze(Ve,_5);Cd(Ve.prototype,"seed",ake);Cd(Ve.prototype,"seedLength",ske);Kze(Ve.prototype,"state",gke,vke);Cd(Ve.prototype,"stateLength",uke);Cd(Ve.prototype,"byteLength",oke);Yi(Ve.prototype,"_read",fke);Yi(Ve.prototype,"destroy",dke);T5.exports=Ve});var M5=s(function(bQe,j5){"use strict";var lke=require("@stdlib/assert/is-plain-object"),cke=require("@stdlib/object/assign"),mke=require("@stdlib/string/format"),hke=Bd();function pke(r,e){var i;if(arguments.length>1){if(i=e,!lke(i))throw new TypeError(mke("invalid argument. Options argument must be an object. Value: `%s`.",i));i=cke({},e)}else i={};return i.objectMode=!0,new hke(r,i)}j5.exports=pke});var W5=s(function(wQe,F5){"use strict";var yke=require("@stdlib/assert/is-positive-number").isPrimitive,x5=require("@stdlib/assert/is-plain-object"),G5=require("@stdlib/object/assign"),A5=require("@stdlib/string/format"),V5=Bd();function qke(r,e){var i,t,n;if(i=arguments.length,i>1){if(!x5(e))throw new TypeError(A5("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=G5({},e)}else if(i===1)if(yke(r))n=u,t={};else{if(!x5(r))throw new TypeError(A5("invalid argument. Options argument must be an object. Value: `%s`.",r));t=G5({},r),n=a}else t={},n=a;return n;function a(o){return new V5(o,t)}function u(){return new V5(r,t)}}F5.exports=qke});var k5=s(function(SQe,z5){"use strict";var I5=require("@stdlib/utils/define-nonenumerable-read-only-property"),Oh=Bd(),bke=M5(),wke=W5();I5(Oh,"objectMode",bke);I5(Oh,"factory",wke);z5.exports=Oh});var J5=s(function(OQe,Ske){Ske.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var B5=s(function(NQe,C5){"use strict";var Oke=require("@stdlib/assert/is-plain-object"),Pr=require("@stdlib/assert/has-own-property"),Nke=require("@stdlib/assert/is-boolean").isPrimitive,Lke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,U5=require("@stdlib/assert/is-string").isPrimitive,Eke=require("@stdlib/assert/is-positive-integer").isPrimitive,Rke=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zn=require("@stdlib/string/format");function Pke(r,e){return Oke(e)?Pr(e,"sep")&&(r.sep=e.sep,!U5(r.sep))?new TypeError(Zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Pr(e,"objectMode")&&(r.objectMode=e.objectMode,!Nke(r.objectMode))?new TypeError(Zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Pr(e,"encoding")&&(r.encoding=e.encoding,!U5(r.encoding)&&r.encoding!==null)?new TypeError(Zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Lke(r.highWaterMark))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Pr(e,"iter")&&(r.iter=e.iter,!Rke(r.iter))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Pr(e,"siter")&&(r.siter=e.siter,!Eke(r.siter))?new TypeError(Zn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Pr(e,"prng")&&(r.prng=e.prng),Pr(e,"seed")&&(r.seed=e.seed),Pr(e,"state")&&(r.state=e.state),Pr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}C5.exports=Pke});var D5=s(function(LQe,X5){"use strict";var _ke=require("debug"),Tke=_ke("random:streams:triangular");X5.exports=Tke});var Yd=s(function(EQe,Q5){"use strict";var Z5=require("readable-stream").Readable,Nh=require("@stdlib/assert/is-number").isPrimitive,Lh=require("@stdlib/math/base/assert/is-nan"),jke=require("@stdlib/assert/is-error"),Mke=require("@stdlib/object/assign"),xke=require("@stdlib/utils/inherit"),Y5=require("@stdlib/utils/define-nonenumerable-property"),Hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dd=require("@stdlib/utils/define-read-only-accessor"),Gke=require("@stdlib/utils/define-read-write-accessor"),Ake=fu().factory,H5=require("@stdlib/buffer/from-string"),Vke=require("@stdlib/utils/next-tick"),Xd=require("@stdlib/string/format"),Fke=J5(),Wke=B5(),gs=D5();function Ike(){return this._prng.seed}function zke(){return this._prng.seedLength}function kke(){return this._prng.stateLength}function Jke(){return this._prng.byteLength}function Uke(){return this._prng.state}function Cke(r){this._prng.state=r}function Bke(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return gs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),gs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=H5(e):e=H5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Xke(r){var e;if(this._destroyed)return gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Vke(i),this;function i(){r&&(gs("Stream was destroyed due to an error. Error: %s.",jke(r)?r.message:JSON.stringify(r)),e.emit("error",r)),gs("Closing the stream..."),e.emit("close")}}function Fe(r,e,i,t){var n,a;if(!(this instanceof Fe))return arguments.length>3?new Fe(r,e,i,t):new Fe(r,e,i);if(!Nh(r)||Lh(r))throw new TypeError(Xd("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Nh(e)||Lh(e))throw new TypeError(Xd("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!Nh(i)||Lh(i))throw new TypeError(Xd("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",i));if(!(r<=i&&i<=e))throw new RangeError(Xd("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,i));if(n=Mke({},Fke),arguments.length>3&&(a=Wke(n,t),a))throw a;return gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),Z5.call(this,n),Y5(this,"_destroyed",!1),Hi(this,"_objectMode",n.objectMode),Hi(this,"_sep",n.sep),Hi(this,"_iter",n.iter),Hi(this,"_siter",n.siter),Y5(this,"_i",0),Hi(this,"_prng",Ake(r,e,i,n)),Hi(this,"PRNG",this._prng.PRNG),this}xke(Fe,Z5);Dd(Fe.prototype,"seed",Ike);Dd(Fe.prototype,"seedLength",zke);Gke(Fe.prototype,"state",Uke,Cke);Dd(Fe.prototype,"stateLength",kke);Dd(Fe.prototype,"byteLength",Jke);Hi(Fe.prototype,"_read",Bke);Hi(Fe.prototype,"destroy",Xke);Q5.exports=Fe});var K5=s(function(RQe,$5){"use strict";var Dke=require("@stdlib/assert/is-plain-object"),Yke=require("@stdlib/object/assign"),Hke=require("@stdlib/string/format"),Zke=Yd();function Qke(r,e,i,t){var n;if(arguments.length>3){if(n=t,!Dke(n))throw new TypeError(Hke("invalid argument. Options argument must be an object. Value: `%s`.",n));n=Yke({},t)}else n={};return n.objectMode=!0,new Zke(r,e,i,n)}$5.exports=Qke});var a4=s(function(PQe,n4){"use strict";var e4=require("@stdlib/assert/is-plain-object"),r4=require("@stdlib/object/assign"),t4=require("@stdlib/string/format"),i4=Yd();function $ke(r,e,i,t){var n,a,u;if(n=arguments.length,n===1){if(!e4(r))throw new TypeError(t4("invalid argument. Options argument must be an object. Value: `%s`.",r));a=r4({},r)}else if(n>3){if(!e4(t))throw new TypeError(t4("invalid argument. Options argument must be an object. Value: `%s`.",t));a=r4({},t)}else a={};return n<3?u=o:u=g,u;function o(d,m,c){return new i4(d,m,c,a)}function g(){return new i4(r,e,i,a)}}n4.exports=$ke});var o4=s(function(_Qe,u4){"use strict";var s4=require("@stdlib/utils/define-nonenumerable-read-only-property"),Eh=Yd(),Kke=K5(),e3e=a4();s4(Eh,"objectMode",Kke);s4(Eh,"factory",e3e);u4.exports=Eh});var g4=s(function(TQe,r3e){r3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var d4=s(function(jQe,f4){"use strict";var t3e=require("@stdlib/assert/is-plain-object"),_r=require("@stdlib/assert/has-own-property"),i3e=require("@stdlib/assert/is-boolean").isPrimitive,n3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,v4=require("@stdlib/assert/is-string").isPrimitive,a3e=require("@stdlib/assert/is-positive-integer").isPrimitive,s3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qn=require("@stdlib/string/format");function u3e(r,e){return t3e(e)?_r(e,"sep")&&(r.sep=e.sep,!v4(r.sep))?new TypeError(Qn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):_r(e,"objectMode")&&(r.objectMode=e.objectMode,!i3e(r.objectMode))?new TypeError(Qn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):_r(e,"encoding")&&(r.encoding=e.encoding,!v4(r.encoding)&&r.encoding!==null)?new TypeError(Qn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):_r(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!n3e(r.highWaterMark))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):_r(e,"iter")&&(r.iter=e.iter,!s3e(r.iter))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):_r(e,"siter")&&(r.siter=e.siter,!a3e(r.siter))?new TypeError(Qn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(_r(e,"prng")&&(r.prng=e.prng),_r(e,"seed")&&(r.seed=e.seed),_r(e,"state")&&(r.state=e.state),_r(e,"copy")&&(r.copy=e.copy),null):new TypeError(Qn("invalid argument. Options argument must be an object. Value: `%s`.",e))}f4.exports=u3e});var c4=s(function(MQe,l4){"use strict";var o3e=require("debug"),g3e=o3e("random:streams:uniform");l4.exports=g3e});var Zd=s(function(xQe,b4){"use strict";var q4=require("readable-stream").Readable,m4=require("@stdlib/assert/is-number").isPrimitive,h4=require("@stdlib/math/base/assert/is-nan"),v3e=require("@stdlib/assert/is-error"),f3e=require("@stdlib/object/assign"),d3e=require("@stdlib/utils/inherit"),p4=require("@stdlib/utils/define-nonenumerable-property"),Zi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hd=require("@stdlib/utils/define-read-only-accessor"),l3e=require("@stdlib/utils/define-read-write-accessor"),c3e=vn().factory,y4=require("@stdlib/buffer/from-string"),m3e=require("@stdlib/utils/next-tick"),Rh=require("@stdlib/string/format"),h3e=g4(),p3e=d4(),vs=c4();function y3e(){return this._prng.seed}function q3e(){return this._prng.seedLength}function b3e(){return this._prng.stateLength}function w3e(){return this._prng.byteLength}function S3e(){return this._prng.state}function O3e(r){this._prng.state=r}function N3e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return vs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),vs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=y4(e):e=y4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function L3e(r){var e;if(this._destroyed)return vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,m3e(i),this;function i(){r&&(vs("Stream was destroyed due to an error. Error: %s.",v3e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),vs("Closing the stream..."),e.emit("close")}}function We(r,e,i){var t,n;if(!(this instanceof We))return arguments.length>2?new We(r,e,i):new We(r,e);if(!m4(r)||h4(r))throw new TypeError(Rh("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!m4(e)||h4(e))throw new TypeError(Rh("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(Rh("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(t=f3e({},h3e),arguments.length>2&&(n=p3e(t,i),n))throw n;return vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),q4.call(this,t),p4(this,"_destroyed",!1),Zi(this,"_objectMode",t.objectMode),Zi(this,"_sep",t.sep),Zi(this,"_iter",t.iter),Zi(this,"_siter",t.siter),p4(this,"_i",0),Zi(this,"_prng",c3e(r,e,t)),Zi(this,"PRNG",this._prng.PRNG),this}d3e(We,q4);Hd(We.prototype,"seed",y3e);Hd(We.prototype,"seedLength",q3e);l3e(We.prototype,"state",S3e,O3e);Hd(We.prototype,"stateLength",b3e);Hd(We.prototype,"byteLength",w3e);Zi(We.prototype,"_read",N3e);Zi(We.prototype,"destroy",L3e);b4.exports=We});var S4=s(function(GQe,w4){"use strict";var E3e=require("@stdlib/assert/is-plain-object"),R3e=require("@stdlib/object/assign"),P3e=require("@stdlib/string/format"),_3e=Zd();function T3e(r,e,i){var t;if(arguments.length>2){if(t=i,!E3e(t))throw new TypeError(P3e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=R3e({},i)}else t={};return t.objectMode=!0,new _3e(r,e,t)}w4.exports=T3e});var P4=s(function(AQe,R4){"use strict";var O4=require("@stdlib/assert/is-plain-object"),N4=require("@stdlib/object/assign"),L4=require("@stdlib/string/format"),E4=Zd();function j3e(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!O4(r))throw new TypeError(L4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=N4({},r)}else if(t>2){if(!O4(i))throw new TypeError(L4("invalid argument. Options argument must be an object. Value: `%s`.",i));n=N4({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new E4(g,d,n)}function o(){return new E4(r,e,n)}}R4.exports=j3e});var j4=s(function(VQe,T4){"use strict";var _4=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ph=Zd(),M3e=S4(),x3e=P4();_4(Ph,"objectMode",M3e);_4(Ph,"factory",x3e);T4.exports=Ph});var M4=s(function(FQe,G3e){G3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var A4=s(function(WQe,G4){"use strict";var A3e=require("@stdlib/assert/is-plain-object"),Tr=require("@stdlib/assert/has-own-property"),V3e=require("@stdlib/assert/is-boolean").isPrimitive,F3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,x4=require("@stdlib/assert/is-string").isPrimitive,W3e=require("@stdlib/assert/is-positive-integer").isPrimitive,I3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$n=require("@stdlib/string/format");function z3e(r,e){return A3e(e)?Tr(e,"sep")&&(r.sep=e.sep,!x4(r.sep))?new TypeError($n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Tr(e,"objectMode")&&(r.objectMode=e.objectMode,!V3e(r.objectMode))?new TypeError($n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Tr(e,"encoding")&&(r.encoding=e.encoding,!x4(r.encoding)&&r.encoding!==null)?new TypeError($n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!F3e(r.highWaterMark))?new TypeError($n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Tr(e,"iter")&&(r.iter=e.iter,!I3e(r.iter))?new TypeError($n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Tr(e,"siter")&&(r.siter=e.siter,!W3e(r.siter))?new TypeError($n("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Tr(e,"prng")&&(r.prng=e.prng),Tr(e,"seed")&&(r.seed=e.seed),Tr(e,"state")&&(r.state=e.state),Tr(e,"copy")&&(r.copy=e.copy),null):new TypeError($n("invalid argument. Options argument must be an object. Value: `%s`.",e))}G4.exports=z3e});var F4=s(function(IQe,V4){"use strict";var k3e=require("debug"),J3e=k3e("random:streams:weibull");V4.exports=J3e});var $d=s(function(zQe,U4){"use strict";var J4=require("readable-stream").Readable,W4=require("@stdlib/assert/is-positive-number").isPrimitive,U3e=require("@stdlib/assert/is-error"),C3e=require("@stdlib/object/assign"),B3e=require("@stdlib/utils/inherit"),I4=require("@stdlib/utils/define-nonenumerable-property"),Qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qd=require("@stdlib/utils/define-read-only-accessor"),X3e=require("@stdlib/utils/define-read-write-accessor"),D3e=Oa().factory,z4=require("@stdlib/buffer/from-string"),k4=require("@stdlib/string/format"),Y3e=require("@stdlib/utils/next-tick"),H3e=M4(),Z3e=A4(),fs=F4();function Q3e(){return this._prng.seed}function $3e(){return this._prng.seedLength}function K3e(){return this._prng.stateLength}function eJe(){return this._prng.byteLength}function rJe(){return this._prng.state}function tJe(r){this._prng.state=r}function iJe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return fs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),fs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=z4(e):e=z4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nJe(r){var e;if(this._destroyed)return fs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Y3e(i),this;function i(){r&&(fs("Stream was destroyed due to an error. Error: %s.",U3e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),fs("Closing the stream..."),e.emit("close")}}function Ie(r,e,i){var t,n;if(!(this instanceof Ie))return arguments.length>2?new Ie(r,e,i):new Ie(r,e);if(!W4(r))throw new TypeError(k4("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!W4(e))throw new TypeError(k4("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=C3e({},H3e),arguments.length>2&&(n=Z3e(t,i),n))throw n;return fs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),J4.call(this,t),I4(this,"_destroyed",!1),Qi(this,"_objectMode",t.objectMode),Qi(this,"_sep",t.sep),Qi(this,"_iter",t.iter),Qi(this,"_siter",t.siter),I4(this,"_i",0),Qi(this,"_prng",D3e(r,e,t)),Qi(this,"PRNG",this._prng.PRNG),this}B3e(Ie,J4);Qd(Ie.prototype,"seed",Q3e);Qd(Ie.prototype,"seedLength",$3e);X3e(Ie.prototype,"state",rJe,tJe);Qd(Ie.prototype,"stateLength",K3e);Qd(Ie.prototype,"byteLength",eJe);Qi(Ie.prototype,"_read",iJe);Qi(Ie.prototype,"destroy",nJe);U4.exports=Ie});var B4=s(function(kQe,C4){"use strict";var aJe=require("@stdlib/assert/is-plain-object"),sJe=require("@stdlib/object/assign"),uJe=require("@stdlib/string/format"),oJe=$d();function gJe(r,e,i){var t;if(arguments.length>2){if(t=i,!aJe(t))throw new TypeError(uJe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=sJe({},i)}else t={};return t.objectMode=!0,new oJe(r,e,t)}C4.exports=gJe});var Q4=s(function(JQe,Z4){"use strict";var X4=require("@stdlib/assert/is-plain-object"),D4=require("@stdlib/object/assign"),Y4=require("@stdlib/string/format"),H4=$d();function vJe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!X4(r))throw new TypeError(Y4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=D4({},r)}else if(t>2){if(!X4(i))throw new TypeError(Y4("invalid argument. Options argument must be an object. Value: `%s`.",i));n=D4({},i)}else n={};return t<2?a=u:a=o,a;function u(g,d){return new H4(g,d,n)}function o(){return new H4(r,e,n)}}Z4.exports=vJe});var eY=s(function(UQe,K4){"use strict";var $4=require("@stdlib/utils/define-nonenumerable-read-only-property"),_h=$d(),fJe=B4(),dJe=Q4();$4(_h,"objectMode",fJe);$4(_h,"factory",dJe);K4.exports=_h});var tY=s(function(CQe,rY){"use strict";var T=require("@stdlib/utils/define-read-only-property"),P={};T(P,"arcsine",SI());T(P,"bernoulli",UI());T(P,"beta",dz());T(P,"betaprime",Az());T(P,"binomial",ik());T(P,"boxMuller",bk());T(P,"cauchy",Jk());T(P,"chi",g3());T(P,"chisquare",T3());T(P,"cosine",$3());T(P,"discreteUniform",bJ());T(P,"erlang",JJ());T(P,"exponential",gU());T(P,"f",MU());T(P,"frechet",eC());T(P,"gamma",OC());T(P,"geometric",CC());T(P,"gumbel",dB());T(P,"hypergeometric",xB());T(P,"improvedZiggurat",ZB());T(P,"invgamma",q9());T(P,"kumaraswamy",J9());T(P,"laplace",v8());T(P,"levy",M8());T(P,"logistic",eX());T(P,"lognormal",SX());T(P,"minstd",zX());T(P,"minstdShuffle",n7());T(P,"mt19937",S7());T(P,"negativeBinomial",C7());T(P,"normal",d6());T(P,"pareto1",A6());T(P,"poisson",tD());T(P,"randi",qD());T(P,"randn",VD());T(P,"randu",KD());T(P,"rayleigh",b5());T(P,"t",k5());T(P,"triangular",o4());T(P,"uniform",j4());T(P,"weibull",eY());rY.exports=P});var jh=s(function(BQe,nY){"use strict";var iY=require("@stdlib/array/base/assert/is-accessor-array"),Th=Ki();function lJe(r,e,i,t,n,a,u,o){var g,d,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return iY(r)?d=r.get(i):d=r[i],iY(t)?m=t.get(a):m=t[a],g.fcn=Th.factory(d,m,o),g;g.fcn=Th.factory(o)}else g.fcn=Th;return g.arity+=2,g}nY.exports=lJe});var sY=s(function(XQe,aY){"use strict";var cJe=require("@stdlib/strided/base/nullary"),mJe=require("@stdlib/strided/base/binary"),hJe=jh();function pJe(r,e,i,t,n,a,u,o){var g=hJe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(cJe([a],[r],[u],g.fcn),a):(mJe([e,t,a],[r],[i,n,u],g.fcn),a)}aY.exports=pJe});var oY=s(function(DQe,uY){"use strict";var yJe=require("@stdlib/strided/base/nullary").ndarray,qJe=require("@stdlib/strided/base/binary").ndarray,bJe=jh();function wJe(r,e,i,t,n,a,u,o,g,d,m){var c=bJe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(yJe([o],[r],[g],[d],c.fcn),o):(qJe([e,n,o],[r],[i,a,g],[t,u,d],c.fcn),o)}uY.exports=wJe});var fY=s(function(YQe,vY){"use strict";var SJe=require("@stdlib/utils/define-nonenumerable-read-only-property"),gY=sY(),OJe=oY();SJe(gY,"ndarray",OJe);vY.exports=gY});var xh=s(function(HQe,lY){"use strict";var dY=require("@stdlib/array/base/assert/is-accessor-array"),Mh=rn();function NJe(r,e,i,t,n,a,u,o){var g,d,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return dY(r)?d=r.get(i):d=r[i],dY(t)?m=t.get(a):m=t[a],g.fcn=Mh.factory(d,m,o),g;g.fcn=Mh.factory(o)}else g.fcn=Mh;return g.arity+=2,g}lY.exports=NJe});var mY=s(function(ZQe,cY){"use strict";var LJe=require("@stdlib/strided/base/nullary"),EJe=require("@stdlib/strided/base/binary"),RJe=xh();function PJe(r,e,i,t,n,a,u,o){var g=RJe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(LJe([a],[r],[u],g.fcn),a):(EJe([e,t,a],[r],[i,n,u],g.fcn),a)}cY.exports=PJe});var pY=s(function(QQe,hY){"use strict";var _Je=require("@stdlib/strided/base/nullary").ndarray,TJe=require("@stdlib/strided/base/binary").ndarray,jJe=xh();function MJe(r,e,i,t,n,a,u,o,g,d,m){var c=jJe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(_Je([o],[r],[g],[d],c.fcn),o):(TJe([e,n,o],[r],[i,a,g],[t,u,d],c.fcn),o)}hY.exports=MJe});var bY=s(function($Qe,qY){"use strict";var xJe=require("@stdlib/utils/define-nonenumerable-read-only-property"),yY=mY(),GJe=pY();xJe(yY,"ndarray",GJe);qY.exports=yY});var Ah=s(function(KQe,SY){"use strict";var wY=require("@stdlib/array/base/assert/is-accessor-array"),Gh=tn();function AJe(r,e,i,t,n,a,u,o){var g,d,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return wY(r)?d=r.get(i):d=r[i],wY(t)?m=t.get(a):m=t[a],g.fcn=Gh.factory(d,m,o),g;g.fcn=Gh.factory(o)}else g.fcn=Gh;return g.arity+=2,g}SY.exports=AJe});var NY=s(function(e$e,OY){"use strict";var VJe=require("@stdlib/strided/base/nullary"),FJe=require("@stdlib/strided/base/binary"),WJe=Ah();function IJe(r,e,i,t,n,a,u,o){var g=WJe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(VJe([a],[r],[u],g.fcn),a):(FJe([e,t,a],[r],[i,n,u],g.fcn),a)}OY.exports=IJe});var EY=s(function(r$e,LY){"use strict";var zJe=require("@stdlib/strided/base/nullary").ndarray,kJe=require("@stdlib/strided/base/binary").ndarray,JJe=Ah();function UJe(r,e,i,t,n,a,u,o,g,d,m){var c=JJe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(zJe([o],[r],[g],[d],c.fcn),o):(kJe([e,n,o],[r],[i,a,g],[t,u,d],c.fcn),o)}LY.exports=UJe});var _Y=s(function(t$e,PY){"use strict";var CJe=require("@stdlib/utils/define-nonenumerable-read-only-property"),RY=NY(),BJe=EY();CJe(RY,"ndarray",BJe);PY.exports=RY});var Fh=s(function(i$e,jY){"use strict";var TY=require("@stdlib/array/base/assert/is-accessor-array"),Vh=nn();function XJe(r,e,i,t,n,a,u,o){var g,d,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return TY(r)?d=r.get(i):d=r[i],TY(t)?m=t.get(a):m=t[a],g.fcn=Vh.factory(d,m,o),g;g.fcn=Vh.factory(o)}else g.fcn=Vh;return g.arity+=2,g}jY.exports=XJe});var xY=s(function(n$e,MY){"use strict";var DJe=require("@stdlib/strided/base/nullary"),YJe=require("@stdlib/strided/base/binary"),HJe=Fh();function ZJe(r,e,i,t,n,a,u,o){var g=HJe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(DJe([a],[r],[u],g.fcn),a):(YJe([e,t,a],[r],[i,n,u],g.fcn),a)}MY.exports=ZJe});var AY=s(function(a$e,GY){"use strict";var QJe=require("@stdlib/strided/base/nullary").ndarray,$Je=require("@stdlib/strided/base/binary").ndarray,KJe=Fh();function eUe(r,e,i,t,n,a,u,o,g,d,m){var c=KJe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(QJe([o],[r],[g],[d],c.fcn),o):($Je([e,n,o],[r],[i,a,g],[t,u,d],c.fcn),o)}GY.exports=eUe});var WY=s(function(s$e,FY){"use strict";var rUe=require("@stdlib/utils/define-nonenumerable-read-only-property"),VY=xY(),tUe=AY();rUe(VY,"ndarray",tUe);FY.exports=VY});var Ih=s(function(u$e,zY){"use strict";var IY=require("@stdlib/array/base/assert/is-accessor-array"),Wh=an();function iUe(r,e,i,t,n,a,u,o){var g,d,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return IY(r)?d=r.get(i):d=r[i],IY(t)?m=t.get(a):m=t[a],g.fcn=Wh.factory(d,m,o),g;g.fcn=Wh.factory(o)}else g.fcn=Wh;return g.arity+=2,g}zY.exports=iUe});var JY=s(function(o$e,kY){"use strict";var nUe=require("@stdlib/strided/base/nullary"),aUe=require("@stdlib/strided/base/binary"),sUe=Ih();function uUe(r,e,i,t,n,a,u,o){var g=sUe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(nUe([a],[r],[u],g.fcn),a):(aUe([e,t,a],[r],[i,n,u],g.fcn),a)}kY.exports=uUe});var CY=s(function(g$e,UY){"use strict";var oUe=require("@stdlib/strided/base/nullary").ndarray,gUe=require("@stdlib/strided/base/binary").ndarray,vUe=Ih();function fUe(r,e,i,t,n,a,u,o,g,d,m){var c=vUe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(oUe([o],[r],[g],[d],c.fcn),o):(gUe([e,n,o],[r],[i,a,g],[t,u,d],c.fcn),o)}UY.exports=fUe});var DY=s(function(v$e,XY){"use strict";var dUe=require("@stdlib/utils/define-nonenumerable-read-only-property"),BY=JY(),lUe=CY();dUe(BY,"ndarray",lUe);XY.exports=BY});var kh=s(function(f$e,YY){"use strict";var cUe=require("@stdlib/array/base/assert/is-accessor-array"),zh=sn();function mUe(r,e,i,t,n){var a,u;if(a={arity:0,fcn:null},t){if(e===0)return cUe(r)?u=r.get(i):u=r[i],a.fcn=zh.factory(u,n),a;a.fcn=zh.factory(n)}else a.fcn=zh;return a.arity+=1,a}YY.exports=mUe});var ZY=s(function(d$e,HY){"use strict";var hUe=require("@stdlib/strided/base/nullary"),pUe=require("@stdlib/strided/base/unary"),yUe=kh();function qUe(r,e,i,t,n,a){var u=yUe(e,i,0,arguments.length>5,a);return u.arity===0?(hUe([t],[r],[n],u.fcn),t):(pUe([e,t],[r],[i,n],u.fcn),t)}HY.exports=qUe});var $Y=s(function(l$e,QY){"use strict";var bUe=require("@stdlib/strided/base/nullary").ndarray,wUe=require("@stdlib/strided/base/unary").ndarray,SUe=kh();function OUe(r,e,i,t,n,a,u,o){var g=SUe(e,i,t,arguments.length>7,o);return g.arity===0?(bUe([n],[r],[a],[u],g.fcn),n):(wUe([e,n],[r],[i,a],[t,u],g.fcn),n)}QY.exports=OUe});var rH=s(function(c$e,eH){"use strict";var NUe=require("@stdlib/utils/define-nonenumerable-read-only-property"),KY=ZY(),LUe=$Y();NUe(KY,"ndarray",LUe);eH.exports=KY});var Uh=s(function(m$e,iH){"use strict";var tH=require("@stdlib/array/base/assert/is-accessor-array"),Jh=ze();function EUe(r,e,i,t,n,a,u,o){var g,d,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return tH(r)?d=r.get(i):d=r[i],tH(t)?m=t.get(a):m=t[a],g.fcn=Jh.factory(d,m,o),g;g.fcn=Jh.factory(o)}else g.fcn=Jh;return g.arity+=2,g}iH.exports=EUe});var aH=s(function(h$e,nH){"use strict";var RUe=require("@stdlib/strided/base/nullary"),PUe=require("@stdlib/strided/base/binary"),_Ue=Uh();function TUe(r,e,i,t,n,a,u,o){var g=_Ue(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(RUe([a],[r],[u],g.fcn),a):(PUe([e,t,a],[r],[i,n,u],g.fcn),a)}nH.exports=TUe});var uH=s(function(p$e,sH){"use strict";var jUe=require("@stdlib/strided/base/nullary").ndarray,MUe=require("@stdlib/strided/base/binary").ndarray,xUe=Uh();function GUe(r,e,i,t,n,a,u,o,g,d,m){var c=xUe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(jUe([o],[r],[g],[d],c.fcn),o):(MUe([e,n,o],[r],[i,a,g],[t,u,d],c.fcn),o)}sH.exports=GUe});var vH=s(function(y$e,gH){"use strict";var AUe=require("@stdlib/utils/define-nonenumerable-read-only-property"),oH=aH(),VUe=uH();AUe(oH,"ndarray",VUe);gH.exports=oH});var Bh=s(function(q$e,dH){"use strict";var fH=require("@stdlib/array/base/assert/is-accessor-array"),Ch=un();function FUe(r,e,i,t,n,a,u,o){var g,d,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return fH(r)?d=r.get(i):d=r[i],fH(t)?m=t.get(a):m=t[a],g.fcn=Ch.factory(d,m,o),g;g.fcn=Ch.factory(o)}else g.fcn=Ch;return g.arity+=2,g}dH.exports=FUe});var cH=s(function(b$e,lH){"use strict";var WUe=require("@stdlib/strided/base/nullary"),IUe=require("@stdlib/strided/base/binary"),zUe=Bh();function kUe(r,e,i,t,n,a,u,o){var g=zUe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(WUe([a],[r],[u],g.fcn),a):(IUe([e,t,a],[r],[i,n,u],g.fcn),a)}lH.exports=kUe});var hH=s(function(w$e,mH){"use strict";var JUe=require("@stdlib/strided/base/nullary").ndarray,UUe=require("@stdlib/strided/base/binary").ndarray,CUe=Bh();function BUe(r,e,i,t,n,a,u,o,g,d,m){var c=CUe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(JUe([o],[r],[g],[d],c.fcn),o):(UUe([e,n,o],[r],[i,a,g],[t,u,d],c.fcn),o)}mH.exports=BUe});var qH=s(function(S$e,yH){"use strict";var XUe=require("@stdlib/utils/define-nonenumerable-read-only-property"),pH=cH(),DUe=hH();XUe(pH,"ndarray",DUe);yH.exports=pH});var Dh=s(function(O$e,wH){"use strict";var bH=require("@stdlib/array/base/assert/is-accessor-array"),Xh=on();function YUe(r,e,i,t,n,a,u,o){var g,d,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return bH(r)?d=r.get(i):d=r[i],bH(t)?m=t.get(a):m=t[a],g.fcn=Xh.factory(d,m,o),g;g.fcn=Xh.factory(o)}else g.fcn=Xh;return g.arity+=2,g}wH.exports=YUe});var OH=s(function(N$e,SH){"use strict";var HUe=require("@stdlib/strided/base/nullary"),ZUe=require("@stdlib/strided/base/binary"),QUe=Dh();function $Ue(r,e,i,t,n,a,u,o){var g=QUe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(HUe([a],[r],[u],g.fcn),a):(ZUe([e,t,a],[r],[i,n,u],g.fcn),a)}SH.exports=$Ue});var LH=s(function(L$e,NH){"use strict";var KUe=require("@stdlib/strided/base/nullary").ndarray,eCe=require("@stdlib/strided/base/binary").ndarray,rCe=Dh();function tCe(r,e,i,t,n,a,u,o,g,d,m){var c=rCe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(KUe([o],[r],[g],[d],c.fcn),o):(eCe([e,n,o],[r],[i,a,g],[t,u,d],c.fcn),o)}NH.exports=tCe});var PH=s(function(E$e,RH){"use strict";var iCe=require("@stdlib/utils/define-nonenumerable-read-only-property"),EH=OH(),nCe=LH();iCe(EH,"ndarray",nCe);RH.exports=EH});var jH=s(function(R$e,TH){"use strict";var aCe=require("@stdlib/strided/base/nullary"),_H=H();function sCe(r,e,i,t){var n;return arguments.length>3?n=_H.factory(t):n=_H,aCe([e],[r],[i],n),e}TH.exports=sCe});var GH=s(function(P$e,xH){"use strict";var uCe=require("@stdlib/strided/base/nullary").ndarray,MH=H();function oCe(r,e,i,t,n){var a;return arguments.length>4?a=MH.factory(n):a=MH,uCe([e],[r],[i],[t],a),e}xH.exports=oCe});var FH=s(function(_$e,VH){"use strict";var gCe=require("@stdlib/strided/base/nullary"),AH=H();function vCe(r,e,i,t){var n;return arguments.length>3?n=AH.factory(t):n=AH,gCe([e],[r],[i],n.normalized),e}VH.exports=vCe});var zH=s(function(T$e,IH){"use strict";var fCe=require("@stdlib/strided/base/nullary").ndarray,WH=H();function dCe(r,e,i,t,n){var a;return arguments.length>4?a=WH.factory(n):a=WH,fCe([e],[r],[i],[t],a.normalized),e}IH.exports=dCe});var UH=s(function(j$e,JH){"use strict";var Yh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hh=jH(),lCe=GH(),kH=FH(),cCe=zH();Yh(Hh,"ndarray",lCe);Yh(Hh,"normalized",kH);Yh(kH,"ndarray",cCe);JH.exports=Hh});var XH=s(function(M$e,BH){"use strict";var mCe=require("@stdlib/strided/base/nullary"),CH=Q();function hCe(r,e,i,t){var n;return arguments.length>3?n=CH.factory(t):n=CH,mCe([e],[r],[i],n),e}BH.exports=hCe});var HH=s(function(x$e,YH){"use strict";var pCe=require("@stdlib/strided/base/nullary").ndarray,DH=Q();function yCe(r,e,i,t,n){var a;return arguments.length>4?a=DH.factory(n):a=DH,pCe([e],[r],[i],[t],a),e}YH.exports=yCe});var $H=s(function(G$e,QH){"use strict";var qCe=require("@stdlib/strided/base/nullary"),ZH=Q();function bCe(r,e,i,t){var n;return arguments.length>3?n=ZH.factory(t):n=ZH,qCe([e],[r],[i],n.normalized),e}QH.exports=bCe});var rZ=s(function(A$e,eZ){"use strict";var wCe=require("@stdlib/strided/base/nullary").ndarray,KH=Q();function SCe(r,e,i,t,n){var a;return arguments.length>4?a=KH.factory(n):a=KH,wCe([e],[r],[i],[t],a.normalized),e}eZ.exports=SCe});var nZ=s(function(V$e,iZ){"use strict";var Zh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qh=XH(),OCe=HH(),tZ=$H(),NCe=rZ();Zh(Qh,"ndarray",OCe);Zh(Qh,"normalized",tZ);Zh(tZ,"ndarray",NCe);iZ.exports=Qh});var uZ=s(function(F$e,sZ){"use strict";var LCe=require("@stdlib/strided/base/nullary"),aZ=j();function ECe(r,e,i,t){var n;return arguments.length>3?n=aZ.factory(t):n=aZ,LCe([e],[r],[i],n),e}sZ.exports=ECe});var vZ=s(function(W$e,gZ){"use strict";var RCe=require("@stdlib/strided/base/nullary").ndarray,oZ=j();function PCe(r,e,i,t,n){var a;return arguments.length>4?a=oZ.factory(n):a=oZ,RCe([e],[r],[i],[t],a),e}gZ.exports=PCe});var lZ=s(function(I$e,dZ){"use strict";var _Ce=require("@stdlib/strided/base/nullary"),fZ=j();function TCe(r,e,i,t){var n;return arguments.length>3?n=fZ.factory(t):n=fZ,_Ce([e],[r],[i],n.normalized),e}dZ.exports=TCe});var hZ=s(function(z$e,mZ){"use strict";var jCe=require("@stdlib/strided/base/nullary").ndarray,cZ=j();function MCe(r,e,i,t,n){var a;return arguments.length>4?a=cZ.factory(n):a=cZ,jCe([e],[r],[i],[t],a.normalized),e}mZ.exports=MCe});var qZ=s(function(k$e,yZ){"use strict";var $h=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kh=uZ(),xCe=vZ(),pZ=lZ(),GCe=hZ();$h(Kh,"ndarray",xCe);$h(Kh,"normalized",pZ);$h(pZ,"ndarray",GCe);yZ.exports=Kh});var rp=s(function(J$e,wZ){"use strict";var bZ=require("@stdlib/array/base/assert/is-accessor-array"),ep=gn();function ACe(r,e,i,t,n,a,u,o){var g,d,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return bZ(r)?d=r.get(i):d=r[i],bZ(t)?m=t.get(a):m=t[a],g.fcn=ep.factory(d,m,o),g;g.fcn=ep.factory(o)}else g.fcn=ep;return g.arity+=2,g}wZ.exports=ACe});var OZ=s(function(U$e,SZ){"use strict";var VCe=require("@stdlib/strided/base/nullary"),FCe=require("@stdlib/strided/base/binary"),WCe=rp();function ICe(r,e,i,t,n,a,u,o){var g=WCe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(VCe([a],[r],[u],g.fcn),a):(FCe([e,t,a],[r],[i,n,u],g.fcn),a)}SZ.exports=ICe});var LZ=s(function(C$e,NZ){"use strict";var zCe=require("@stdlib/strided/base/nullary").ndarray,kCe=require("@stdlib/strided/base/binary").ndarray,JCe=rp();function UCe(r,e,i,t,n,a,u,o,g,d,m){var c=JCe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(zCe([o],[r],[g],[d],c.fcn),o):(kCe([e,n,o],[r],[i,a,g],[t,u,d],c.fcn),o)}NZ.exports=UCe});var PZ=s(function(B$e,RZ){"use strict";var CCe=require("@stdlib/utils/define-nonenumerable-read-only-property"),EZ=OZ(),BCe=LZ();CCe(EZ,"ndarray",BCe);RZ.exports=EZ});var jZ=s(function(X$e,TZ){"use strict";var XCe=require("@stdlib/strided/base/nullary"),_Z=qt();function DCe(r,e,i,t){var n;return arguments.length>3?n=_Z.factory(t):n=_Z,XCe([e],[r],[i],n),e}TZ.exports=DCe});var GZ=s(function(D$e,xZ){"use strict";var YCe=require("@stdlib/strided/base/nullary").ndarray,MZ=qt();function HCe(r,e,i,t,n){var a;return arguments.length>4?a=MZ.factory(n):a=MZ,YCe([e],[r],[i],[t],a),e}xZ.exports=HCe});var FZ=s(function(Y$e,VZ){"use strict";var ZCe=require("@stdlib/utils/define-nonenumerable-read-only-property"),AZ=jZ(),QCe=GZ();ZCe(AZ,"ndarray",QCe);VZ.exports=AZ});var ip=s(function(H$e,IZ){"use strict";var WZ=require("@stdlib/array/base/assert/is-accessor-array"),tp=vn();function $Ce(r,e,i,t,n,a,u,o){var g,d,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return WZ(r)?d=r.get(i):d=r[i],WZ(t)?m=t.get(a):m=t[a],g.fcn=tp.factory(d,m,o),g;g.fcn=tp.factory(o)}else g.fcn=tp;return g.arity+=2,g}IZ.exports=$Ce});var kZ=s(function(Z$e,zZ){"use strict";var KCe=require("@stdlib/strided/base/nullary"),eBe=require("@stdlib/strided/base/binary"),rBe=ip();function tBe(r,e,i,t,n,a,u,o){var g=rBe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(KCe([a],[r],[u],g.fcn),a):(eBe([e,t,a],[r],[i,n,u],g.fcn),a)}zZ.exports=tBe});var UZ=s(function(Q$e,JZ){"use strict";var iBe=require("@stdlib/strided/base/nullary").ndarray,nBe=require("@stdlib/strided/base/binary").ndarray,aBe=ip();function sBe(r,e,i,t,n,a,u,o,g,d,m){var c=aBe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(iBe([o],[r],[g],[d],c.fcn),o):(nBe([e,n,o],[r],[i,a,g],[t,u,d],c.fcn),o)}JZ.exports=sBe});var XZ=s(function($$e,BZ){"use strict";var uBe=require("@stdlib/utils/define-nonenumerable-read-only-property"),CZ=kZ(),oBe=UZ();uBe(CZ,"ndarray",oBe);BZ.exports=CZ});var ap=s(function(K$e,YZ){"use strict";var DZ=require("@stdlib/array/base/assert/is-accessor-array"),np=Oa();function gBe(r,e,i,t,n,a,u,o){var g,d,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return DZ(r)?d=r.get(i):d=r[i],DZ(t)?m=t.get(a):m=t[a],g.fcn=np.factory(d,m,o),g;g.fcn=np.factory(o)}else g.fcn=np;return g.arity+=2,g}YZ.exports=gBe});var ZZ=s(function(eKe,HZ){"use strict";var vBe=require("@stdlib/strided/base/nullary"),fBe=require("@stdlib/strided/base/binary"),dBe=ap();function lBe(r,e,i,t,n,a,u,o){var g=dBe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(vBe([a],[r],[u],g.fcn),a):(fBe([e,t,a],[r],[i,n,u],g.fcn),a)}HZ.exports=lBe});var $Z=s(function(rKe,QZ){"use strict";var cBe=require("@stdlib/strided/base/nullary").ndarray,mBe=require("@stdlib/strided/base/binary").ndarray,hBe=ap();function pBe(r,e,i,t,n,a,u,o,g,d,m){var c=hBe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(cBe([o],[r],[g],[d],c.fcn),o):(mBe([e,n,o],[r],[i,a,g],[t,u,d],c.fcn),o)}QZ.exports=pBe});var rQ=s(function(tKe,eQ){"use strict";var yBe=require("@stdlib/utils/define-nonenumerable-read-only-property"),KZ=ZZ(),qBe=$Z();yBe(KZ,"ndarray",qBe);eQ.exports=KZ});var iQ=s(function(iKe,tQ){"use strict";var F=require("@stdlib/utils/define-read-only-property"),A={};F(A,"arcsine",fY());F(A,"beta",bY());F(A,"betaprime",_Y());F(A,"cosine",WY());F(A,"discreteUniform",DY());F(A,"exponential",rH());F(A,"gamma",vH());F(A,"invgamma",qH());F(A,"lognormal",PH());F(A,"minstd",UH());F(A,"minstdShuffle",nZ());F(A,"mt19937",qZ());F(A,"normal",PZ());F(A,"randu",FZ());F(A,"uniform",XZ());F(A,"weibull",rQ());tQ.exports=A});var Kn=require("@stdlib/utils/define-read-only-property"),$i={};Kn($i,"array",$E());Kn($i,"base",a1());Kn($i,"iterators",mW());Kn($i,"sample",IW());Kn($i,"shuffle",KW());Kn($i,"streams",tY());Kn($i,"strided",iQ());module.exports=$i; +"use strict";var s=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var rl=s(function(HBe,np){"use strict";var uQ=require("@stdlib/constants/uint32/max"),oQ=require("@stdlib/math/base/special/floor"),gQ=uQ-1;function vQ(){var r=oQ(1+gQ*Math.random());return r>>>0}np.exports=vQ});var gl=s(function(ZBe,mp){"use strict";var Mr=require("@stdlib/utils/define-nonenumerable-read-only-property"),ut=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ap=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),tl=require("@stdlib/assert/has-own-property"),fQ=require("@stdlib/assert/is-plain-object"),dQ=require("@stdlib/assert/is-collection"),sp=require("@stdlib/assert/is-uint32array"),lQ=require("@stdlib/assert/is-boolean").isPrimitive,up=require("@stdlib/assert/is-positive-integer").isPrimitive,dp=require("@stdlib/constants/float64/max-safe-integer"),lp=require("@stdlib/constants/uint32/max"),z=require("@stdlib/array/uint32"),cQ=require("@stdlib/math/base/special/max"),ol=require("@stdlib/math/base/ops/umul"),ra=require("@stdlib/blas/base/gcopy"),mQ=require("@stdlib/array/to-json"),J=require("@stdlib/string/format"),op=rl(),G=624,il=397,gp=lp>>>0,hQ=19650218,nl=2147483648,al=2147483647,pQ=1812433253,yQ=1664525,qQ=1566083941,bQ=2636928640,wQ=4022730752,SQ=2567483615,sl=[0,SQ>>>0],cp=1/(dp+1),OQ=67108864,NQ=2147483648,ul=1,EQ=dp*cp,Ou=1,Nu=3,ot=2,gt=G+3,k=G+5,cs=G+6;function vp(r,e){var i;return e?i="option":i="argument",r.length>>0,t=1;t>>0,i=(i^i>>>30)>>>0,r[t]=ol(i,pQ)+t>>>0;return r}function LQ(r,e,i,t){var n,a,u,o;for(a=1,u=0,o=cQ(e,t);o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=ol(n,yQ)>>>0,r[a]=(r[a]>>>0^n)+i[u]+u>>>0,a+=1,u+=1,a>=e&&(r[0]=r[e-1],a=1),u>=t&&(u=0);for(o=e-1;o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=ol(n,qQ)>>>0,r[a]=(r[a]>>>0^n)-a>>>0,a+=1,a>=e&&(r[0]=r[e-1],a=1);return r[0]=NQ,r}function RQ(r){var e,i,t,n;for(n=G-il,i=0;i>>1^sl[e&ul];for(t=G-1;i>>1^sl[e&ul];return e=r[t]&nl|r[0]&al,r[t]=r[il-1]^e>>>1^sl[e&ul],r}function PQ(r){var e,i,t,n,a,u;if(t={},arguments.length){if(!fQ(r))throw new TypeError(J("invalid argument. Options argument must be an object. Value: `%s`.",r));if(tl(r,"copy")&&(t.copy=r.copy,!lQ(r.copy)))throw new TypeError(J("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(tl(r,"state")){if(i=r.state,t.state=!0,!sp(i))throw new TypeError(J("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i));if(u=vp(i,!0),u)throw u;t.copy===!1?e=i:(e=new z(i.length),ra(i.length,i,1,e,1)),i=new z(e.buffer,e.byteOffset+(ot+1)*e.BYTES_PER_ELEMENT,G),n=new z(e.buffer,e.byteOffset+(k+1)*e.BYTES_PER_ELEMENT,i[k])}if(n===void 0)if(tl(r,"seed"))if(n=r.seed,t.seed=!0,up(n)){if(n>gp)throw new RangeError(J("invalid option. `%s` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.","seed",n));n>>>=0}else{if(dQ(n)===!1||n.length<1)throw new TypeError(J("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.","seed",n));if(n.length===1){if(n=n[0],!up(n))throw new TypeError(J("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.","seed",n));if(n>gp)throw new RangeError(J("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.","seed",n));n>>>=0}else a=n.length,e=new z(cs+a),e[0]=Ou,e[1]=Nu,e[ot]=G,e[gt]=1,e[gt+1]=G,e[k]=a,ra.ndarray(a,n,1,0,e,1,k+1),i=new z(e.buffer,e.byteOffset+(ot+1)*e.BYTES_PER_ELEMENT,G),n=new z(e.buffer,e.byteOffset+(k+1)*e.BYTES_PER_ELEMENT,a),i=fp(i,G,hQ),i=LQ(i,G,n,a)}else n=op()>>>0}else n=op()>>>0;return i===void 0&&(e=new z(cs+1),e[0]=Ou,e[1]=Nu,e[ot]=G,e[gt]=1,e[gt+1]=G,e[k]=1,e[k+1]=n,i=new z(e.buffer,e.byteOffset+(ot+1)*e.BYTES_PER_ELEMENT,G),n=new z(e.buffer,e.byteOffset+(k+1)*e.BYTES_PER_ELEMENT,1),i=fp(i,G,n)),Mr(d,"NAME","mt19937"),ut(d,"seed",o),ut(d,"seedLength",g),ap(d,"state",c,h),ut(d,"stateLength",f),ut(d,"byteLength",m),Mr(d,"toJSON",y),Mr(d,"MIN",0),Mr(d,"MAX",lp),Mr(d,"normalized",l),Mr(l,"NAME",d.NAME),ut(l,"seed",o),ut(l,"seedLength",g),ap(l,"state",c,h),ut(l,"stateLength",f),ut(l,"byteLength",m),Mr(l,"toJSON",y),Mr(l,"MIN",0),Mr(l,"MAX",EQ),d;function o(){var v=e[k];return ra(v,n,1,new z(v),1)}function g(){return e[k]}function f(){return e.length}function m(){return e.byteLength}function c(){var v=e.length;return ra(v,e,1,new z(v),1)}function h(v){var p;if(!sp(v))throw new TypeError(J("invalid argument. Must provide a Uint32Array. Value: `%s`.",v));if(p=vp(v,!1),p)throw p;t.copy===!1?t.state&&v.length===e.length?ra(v.length,v,1,e,1):(e=v,t.state=!0):(v.length!==e.length&&(e=new z(v.length)),ra(v.length,v,1,e,1)),i=new z(e.buffer,e.byteOffset+(ot+1)*e.BYTES_PER_ELEMENT,G),n=new z(e.buffer,e.byteOffset+(k+1)*e.BYTES_PER_ELEMENT,e[k])}function y(){var v={};return v.type="PRNG",v.name=d.NAME,v.state=mQ(e),v.params=[],v}function d(){var v,p;return p=e[gt+1],p>=G&&(i=RQ(i),p=0),v=i[p],e[gt+1]=p+1,v^=v>>>11,v^=v<<7&bQ,v^=v<<15&wQ,v^=v>>>18,v>>>0}function l(){var v=d()>>>5,p=d()>>>6;return(v*OQ+p)*cp}}mp.exports=PQ});var pp=s(function(QBe,hp){"use strict";var _Q=gl(),TQ=rl(),jQ=_Q({seed:TQ()});hp.exports=jQ});var j=s(function($Be,qp){"use strict";var MQ=require("@stdlib/utils/define-nonenumerable-read-only-property"),yp=pp(),xQ=gl();MQ(yp,"factory",xQ);qp.exports=yp});var Op=s(function(KBe,Sp){"use strict";var bp=require("@stdlib/assert/is-number").isPrimitive,vl=require("@stdlib/string/format"),wp=require("@stdlib/assert/is-nan");function GQ(r,e){return!bp(r)||wp(r)?new TypeError(vl("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!bp(e)||wp(e)?new TypeError(vl("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(vl("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}Sp.exports=GQ});var Ep=s(function(e9e,Np){"use strict";var AQ=require("@stdlib/math/base/special/pow"),VQ=require("@stdlib/math/base/special/sin"),FQ=require("@stdlib/constants/float64/half-pi");function WQ(r,e,i){return e+AQ(VQ(FQ*r()),2)*(i-e)}Np.exports=WQ});var fl=s(function(r9e,xp){"use strict";var xr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Eu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Lp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Rp=require("@stdlib/assert/is-plain-object"),Pp=require("@stdlib/assert/is-function"),_p=require("@stdlib/assert/has-own-property"),Tp=require("@stdlib/utils/constant-function"),IQ=require("@stdlib/utils/noop"),Lu=j().factory,jp=require("@stdlib/math/base/assert/is-nan"),zQ=require("@stdlib/array/to-json"),Ru=require("@stdlib/string/format"),kQ=Op(),Mp=Ep();function JQ(){var r,e,i,t,n,a;if(arguments.length===0)e=Lu();else if(arguments.length===1){if(r=arguments[0],!Rp(r))throw new TypeError(Ru("invalid argument. Options argument must be an object. Value: `%s`.",r));if(_p(r,"prng")){if(!Pp(r.prng))throw new TypeError(Ru("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Lu(r)}else{if(n=arguments[0],a=arguments[1],t=kQ(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!Rp(r))throw new TypeError(Ru("invalid argument. Options argument must be an object. Value: `%s`.",r));if(_p(r,"prng")){if(!Pp(r.prng))throw new TypeError(Ru("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Lu(r)}else e=Lu()}return n===void 0?i=d:i=y,xr(i,"NAME","arcsine"),r&&r.prng?(xr(i,"seed",null),xr(i,"seedLength",null),Lp(i,"state",Tp(null),IQ),xr(i,"stateLength",null),xr(i,"byteLength",null),xr(i,"toJSON",Tp(null)),xr(i,"PRNG",e)):(Eu(i,"seed",u),Eu(i,"seedLength",o),Lp(i,"state",m,c),Eu(i,"stateLength",g),Eu(i,"byteLength",f),xr(i,"toJSON",h),xr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function f(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function h(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=zQ(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return Mp(e,n,a)}function d(l,v){return jp(l)||jp(v)||l>=v?NaN:Mp(e,l,v)}}xp.exports=JQ});var Ap=s(function(t9e,Gp){"use strict";var UQ=fl(),CQ=UQ();Gp.exports=CQ});var en=s(function(i9e,Fp){"use strict";var BQ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vp=Ap(),XQ=fl();BQ(Vp,"factory",XQ);Fp.exports=Vp});var Wp=s(function(n9e,DQ){DQ.exports={dtype:"float64"}});var kp=s(function(a9e,zp){"use strict";var YQ=require("@stdlib/array/typed-real-float-dtypes"),HQ=require("@stdlib/assert/is-plain-object"),ZQ=require("@stdlib/assert/has-own-property"),Ip=require("@stdlib/string/format"),dl=YQ();dl.push("generic");function QQ(r,e){return HQ(e)?ZQ(e,"dtype")&&(r.dtype=e.dtype,dl.indexOf(r.dtype)<0)?new TypeError(Ip('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",dl.join('", "'),r.dtype)):null:new TypeError(Ip("invalid argument. Options argument must be an object. Value: `%s`.",e))}zp.exports=QQ});var ll=s(function(s9e,Dp){"use strict";var Jp=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ms=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Up=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$Q=require("@stdlib/utils/constant-function"),KQ=require("@stdlib/utils/noop"),_u=en(),Cp=require("@stdlib/array/typed-real-float-ctors"),Bp=require("@stdlib/array/base/filled-by"),e$=require("@stdlib/strided/base/nullary"),r$=require("@stdlib/strided/base/binary"),Xp=require("@stdlib/string/format"),t$=Wp(),Tu=kp();function i$(){var r,e,i,t,n,a;if(i={dtype:t$.dtype},e=arguments.length,e===0)n=_u,t=o;else if(e===1){if(r=arguments[0],n=_u.factory(r),a=Tu(i,r),a)throw a;t=o}else if(e===2)n=_u.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=_u.factory(arguments[0],arguments[1],r),a=Tu(i,r),a)throw a;t=u}return r&&r.prng?(ms(t,"seed",null),ms(t,"seedLength",null),Up(t,"state",$Q(null),KQ),ms(t,"stateLength",null),ms(t,"byteLength",null)):(Pu(t,"seed",g),Pu(t,"seedLength",f),Up(t,"state",h,y),Pu(t,"stateLength",m),Pu(t,"byteLength",c)),ms(t,"PRNG",n.PRNG),t;function u(d,l){var v,p,q,b,w;if(!Jp(d))throw new TypeError(Xp("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=Tu(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?Bp(d,n):(v=Cp(b),p=new v(d),e$([p],[d],[1],n),p)}function o(d,l,v,p){var q,b,w,S,O;if(!Jp(d))throw new TypeError(Xp("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(O={},arguments.length>3&&(w=Tu(O,p),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return Bp(d,M);return q=Cp(S),b=new q(d),r$([[l],[v],b],[d],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}Dp.exports=i$});var Hp=s(function(u9e,Yp){"use strict";var n$=ll(),a$=n$();Yp.exports=a$});var $p=s(function(o9e,Qp){"use strict";var s$=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zp=Hp(),u$=ll();s$(Zp,"factory",u$);Qp.exports=Zp});var ty=s(function(g9e,ry){"use strict";var o$=require("@stdlib/math/base/special/sqrt"),Kp=require("@stdlib/math/base/special/exp"),g$=require("@stdlib/math/base/special/ln"),ey=.00991256303526217;function v$(r,e){var i,t,n;for(t=Kp(-.5*e*e),i=[],i.push(ey/t),i.push(e),n=2;n=0&&f<=1&&(g=r(),n=hl(u,4),m=8*i-12,m=1-n/m,g<=m?t=!1:(m+=.5*hl(n/(8*i-8),2),g=Py(g)&&(t=!1))));return f}_y.exports=W$});var My=s(function(q9e,jy){"use strict";var I$=require("@stdlib/math/base/special/pow"),xu=require("@stdlib/math/base/special/ln");function z$(r,e,i,t){var n,a,u,o,g,f,m,c,h,y,d;for(o=i-1,g=t-1,f=o+g,m=f*xu(f),u=o/f,n=.5/I$(f,.5),a=!0;a===!0;)c=e(),y=u+c*n,y>=0&&y<=1&&(h=r(),d=o*xu(y/o),d+=g*xu((1-y)/g),d+=m+.5*c*c,d>=xu(h)&&(a=!1));return y}jy.exports=z$});var Ay=s(function(b9e,Gy){"use strict";var pl=require("@stdlib/math/base/special/exp"),xy=require("@stdlib/math/base/special/pow"),yl=require("@stdlib/math/base/special/ln");function k$(r,e,i){for(var t,n,a,u,o,g,f;;)if(u=r(),o=r(),g=xy(u,1/e),f=xy(o,1/i),a=g+f,a<=1)return a>0?g/a:(t=yl(u)/e,n=yl(o)/i,t>n?(n-=t,t=0):(t-=n,n=0),pl(t-yl(pl(t)+pl(n))))}Gy.exports=k$});var Wy=s(function(w9e,Fy){"use strict";var Vy=Ry(),J$=Ty(),U$=My(),C$=Ay();function B$(r,e,i,t){var n,a;return i===t&&i>1.5?J$(r,e,i):i>1&&t>1?U$(r,e,i,t):i<1&&t<1?C$(r,i,t):(n=Vy(r,e,i),a=Vy(r,e,t),n/(n+a))}Fy.exports=B$});var Sl=s(function(S9e,Yy){"use strict";var Gr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Iy=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zy=require("@stdlib/assert/is-plain-object"),ky=require("@stdlib/assert/is-boolean").isPrimitive,Jy=require("@stdlib/assert/is-function"),ta=require("@stdlib/assert/has-own-property"),Uy=require("@stdlib/utils/constant-function"),X$=require("@stdlib/utils/noop"),Cy=H().factory,Au=j().factory,By=require("@stdlib/math/base/assert/is-nan"),ql=require("@stdlib/blas/base/gcopy"),bl=require("@stdlib/array/uint32"),wl=require("@stdlib/assert/is-uint32array"),Xy=require("@stdlib/object/assign"),D$=require("@stdlib/array/to-json"),Ar=require("@stdlib/string/format"),Y$=Sy(),Dy=Wy();function H$(){var r,e,i,t,n,a,u,o,g;if(o=!0,arguments.length===0)n={copy:!1},a=Au(n);else if(arguments.length===1){if(n=arguments[0],!zy(n))throw new TypeError(Ar("invalid argument. Options argument must be an object. Value: `%s`.",n));if(ta(n,"copy")&&!ky(n.copy))throw new TypeError(Ar("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(ta(n,"prng")){if(!Jy(n.prng))throw new TypeError(Ar("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(ta(n,"state")&&!wl(n.state))throw new TypeError(Ar("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Xy({},n),n.copy===!1?o=!1:n.state&&(n.state=ql(n.state.length,n.state,1,new bl(n.state.length),1)),n.copy=!1,a=Au(n)}}else{if(i=arguments[0],t=arguments[1],g=Y$(i,t),g)throw g;if(arguments.length>2){if(n=arguments[2],!zy(n))throw new TypeError(Ar("invalid argument. Options argument must be an object. Value: `%s`.",n));if(ta(n,"copy")&&!ky(n.copy))throw new TypeError(Ar("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(ta(n,"prng")){if(!Jy(n.prng))throw new TypeError(Ar("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(ta(n,"state")&&!wl(n.state))throw new TypeError(Ar("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Xy({},n),n.copy===!1?o=!1:n.state&&(n.state=ql(n.state.length,n.state,1,new bl(n.state.length),1)),n.copy=!1,a=Au(n)}}else n={copy:!1},a=Au(n)}return n&&n.prng?e=Cy({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),e=Cy({state:r,copy:!1})),i===void 0?u=p:u=v,Gr(u,"NAME","beta"),n&&n.prng?(Gr(u,"seed",null),Gr(u,"seedLength",null),Iy(u,"state",Uy(null),X$),Gr(u,"stateLength",null),Gr(u,"byteLength",null),Gr(u,"toJSON",Uy(null)),Gr(u,"PRNG",a)):(Gu(u,"seed",f),Gu(u,"seedLength",m),Iy(u,"state",y,d),Gu(u,"stateLength",c),Gu(u,"byteLength",h),Gr(u,"toJSON",l),Gr(u,"PRNG",a),a=a.normalized),u;function f(){return a.seed}function m(){return a.seedLength}function c(){return a.stateLength}function h(){return a.byteLength}function y(){return a.state}function d(q){if(!wl(q))throw new TypeError(Ar("invalid argument. Must provide a Uint32Array. Value: `%s`.",q));o&&(q=ql(q.length,q,1,new bl(q.length),1)),a.state=q}function l(){var q={};return q.type="PRNG",q.name=u.NAME,q.state=D$(a.state),i===void 0?q.params=[]:q.params=[i,t],q}function v(){return Dy(a,e,i,t)}function p(q,b){return By(q)||By(b)||q<=0||b<=0?NaN:Dy(a,e,q,b)}}Yy.exports=H$});var Zy=s(function(O9e,Hy){"use strict";var Z$=Sl(),Q$=Z$();Hy.exports=Q$});var tn=s(function(N9e,$y){"use strict";var $$=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qy=Zy(),K$=Sl();$$(Qy,"factory",K$);$y.exports=Qy});var Ky=s(function(E9e,eK){eK.exports={dtype:"float64"}});var tq=s(function(L9e,rq){"use strict";var rK=require("@stdlib/array/typed-real-float-dtypes"),tK=require("@stdlib/assert/is-plain-object"),iK=require("@stdlib/assert/has-own-property"),eq=require("@stdlib/string/format"),Ol=rK();Ol.push("generic");function nK(r,e){return tK(e)?iK(e,"dtype")&&(r.dtype=e.dtype,Ol.indexOf(r.dtype)<0)?new TypeError(eq('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Ol.join('", "'),r.dtype)):null:new TypeError(eq("invalid argument. Options argument must be an object. Value: `%s`.",e))}rq.exports=nK});var Nl=s(function(R9e,oq){"use strict";var iq=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ps=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),nq=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),aK=require("@stdlib/utils/constant-function"),sK=require("@stdlib/utils/noop"),Fu=tn(),aq=require("@stdlib/array/typed-real-float-ctors"),sq=require("@stdlib/array/base/filled-by"),uK=require("@stdlib/strided/base/nullary"),oK=require("@stdlib/strided/base/binary"),uq=require("@stdlib/string/format"),gK=Ky(),Wu=tq();function vK(){var r,e,i,t,n,a;if(i={dtype:gK.dtype},e=arguments.length,e===0)n=Fu,t=o;else if(e===1){if(r=arguments[0],n=Fu.factory(r),a=Wu(i,r),a)throw a;t=o}else if(e===2)n=Fu.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=Fu.factory(arguments[0],arguments[1],r),a=Wu(i,r),a)throw a;t=u}return r&&r.prng?(ps(t,"seed",null),ps(t,"seedLength",null),nq(t,"state",aK(null),sK),ps(t,"stateLength",null),ps(t,"byteLength",null)):(Vu(t,"seed",g),Vu(t,"seedLength",f),nq(t,"state",h,y),Vu(t,"stateLength",m),Vu(t,"byteLength",c)),ps(t,"PRNG",n.PRNG),t;function u(d,l){var v,p,q,b,w;if(!iq(d))throw new TypeError(uq("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=Wu(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?sq(d,n):(v=aq(b),p=new v(d),uK([p],[d],[1],n),p)}function o(d,l,v,p){var q,b,w,S,O;if(!iq(d))throw new TypeError(uq("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(O={},arguments.length>3&&(w=Wu(O,p),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return sq(d,M);return q=aq(S),b=new q(d),oK([[l],[v],b],[d],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}oq.exports=vK});var vq=s(function(P9e,gq){"use strict";var fK=Nl(),dK=fK();gq.exports=dK});var lq=s(function(_9e,dq){"use strict";var lK=require("@stdlib/utils/define-nonenumerable-read-only-property"),fq=vq(),cK=Nl();lK(fq,"factory",cK);dq.exports=fq});var pq=s(function(T9e,hq){"use strict";var cq=require("@stdlib/assert/is-positive-number").isPrimitive,mq=require("@stdlib/string/format");function mK(r,e){return cq(r)?cq(e)?null:new TypeError(mq("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(mq("invalid argument. First argument must be a positive number. Value: `%s`.",r))}hq.exports=mK});var bq=s(function(j9e,qq){"use strict";var yq=require("@stdlib/math/base/special/ln");function hK(r,e,i,t,n){var a,u,o,g,f,m,c;for(a=!0;a;){do f=e(),c=1+n*f;while(c<=0);c*=c*c,u=f*f,o=1-.331*u*u,g=.5*u+t*(1-c+yq(c)),m=r(),(m2){if(n=arguments[2],!Sq(n))throw new TypeError(Fr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(ia(n,"copy")&&!Oq(n.copy))throw new TypeError(Fr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(ia(n,"prng")){if(!Nq(n.prng))throw new TypeError(Fr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(ia(n,"state")&&!El(n.state))throw new TypeError(Fr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=_q({},n),n.copy===!1?o=!1:n.state&&(n.state=Rl(n.state.length,n.state,1,new Pl(n.state.length),1)),n.copy=!1,a=zu(n)}}else n={copy:!1},a=zu(n)}return n&&n.prng?i=Lq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),i=Lq({state:r,copy:!1})),e===void 0?u=w:(e>=1?(u=q,m=e-Ju):(u=b,m=e+1-Ju),f=1/Ll(9*m)),Vr(u,"NAME","gamma"),n&&n.prng?(Vr(u,"seed",null),Vr(u,"seedLength",null),wq(u,"state",Eq(null),pK),Vr(u,"stateLength",null),Vr(u,"byteLength",null),Vr(u,"toJSON",Eq(null)),Vr(u,"PRNG",a)):(Iu(u,"seed",c),Iu(u,"seedLength",h),wq(u,"state",l,v),Iu(u,"stateLength",y),Iu(u,"byteLength",d),Vr(u,"toJSON",p),Vr(u,"PRNG",a),a=a.normalized),u;function c(){return a.seed}function h(){return a.seedLength}function y(){return a.stateLength}function d(){return a.byteLength}function l(){return a.state}function v(S){if(!El(S))throw new TypeError(Fr("invalid argument. Must provide a Uint32Array. Value: `%s`.",S));o&&(S=Rl(S.length,S,1,new Pl(S.length),1)),a.state=S}function p(){var S={};return S.type="PRNG",S.name=u.NAME,S.state=yK(a.state),e===void 0?S.params=[]:S.params=[e,t],S}function q(){return ku(a,i,t,m,f)}function b(){return ku(a,i,t,m,f)*Pq(a(),1/e)}function w(S,O){var M,x;return Rq(S)||Rq(O)||S<=0||O<=0?NaN:S<1?(x=S+1-Ju,M=1/Ll(9*x),ku(a,i,O,x,M)*Pq(a(),1/S)):(x=S-Ju,M=1/Ll(9*x),ku(a,i,O,x,M))}}Tq.exports=bK});var Mq=s(function(x9e,jq){"use strict";var wK=_l(),SK=wK();jq.exports=SK});var ke=s(function(G9e,Gq){"use strict";var OK=require("@stdlib/utils/define-nonenumerable-read-only-property"),xq=Mq(),NK=_l();OK(xq,"factory",NK);Gq.exports=xq});var Wq=s(function(A9e,Fq){"use strict";var Aq=require("@stdlib/assert/is-positive-number").isPrimitive,Vq=require("@stdlib/string/format");function EK(r,e){return Aq(r)?Aq(e)?null:new TypeError(Vq("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(Vq("invalid argument. First argument must be a positive number. Value: `%s`.",r))}Fq.exports=EK});var zq=s(function(V9e,Iq){"use strict";function LK(r,e,i){return r(e,1)/r(i,1)}Iq.exports=LK});var Tl=s(function(F9e,Dq){"use strict";var ft=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kq=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Jq=require("@stdlib/assert/is-plain-object"),Uq=require("@stdlib/utils/constant-function"),RK=require("@stdlib/utils/noop"),Cu=ke().factory,Cq=require("@stdlib/math/base/assert/is-nan"),PK=require("@stdlib/array/to-json"),Bq=require("@stdlib/string/format"),_K=Wq(),Xq=zq();function TK(){var r,e,i,t,n,a,u;if(arguments.length===0)r=Cu();else if(arguments.length===1){if(t=arguments[0],!Jq(t))throw new TypeError(Bq("invalid argument. Options argument must be an object. Value: `%s`.",t));r=Cu(t)}else{if(e=arguments[0],i=arguments[1],u=_K(e,i),u)throw u;if(arguments.length>2){if(t=arguments[2],!Jq(t))throw new TypeError(Bq("invalid argument. Options argument must be an object. Value: `%s`.",t));r=Cu(t)}else r=Cu()}return e===void 0?a=l:a=d,n=r.PRNG,ft(a,"NAME","betaprime"),t&&t.prng?(ft(a,"seed",null),ft(a,"seedLength",null),kq(a,"state",Uq(null),RK),ft(a,"stateLength",null),ft(a,"byteLength",null),ft(a,"toJSON",Uq(null))):(Uu(a,"seed",o),Uu(a,"seedLength",g),kq(a,"state",c,h),Uu(a,"stateLength",f),Uu(a,"byteLength",m),ft(a,"toJSON",y)),ft(a,"PRNG",n),a;function o(){return n.seed}function g(){return n.seedLength}function f(){return n.stateLength}function m(){return n.byteLength}function c(){return n.state}function h(v){n.state=v}function y(){var v={};return v.type="PRNG",v.name=a.NAME,v.state=PK(n.state),e===void 0?v.params=[]:v.params=[e,i],v}function d(){return Xq(r,e,i)}function l(v,p){return Cq(v)||Cq(p)||v<=0||p<=0?NaN:Xq(r,v,p)}}Dq.exports=TK});var Hq=s(function(W9e,Yq){"use strict";var jK=Tl(),MK=jK();Yq.exports=MK});var nn=s(function(I9e,Qq){"use strict";var xK=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zq=Hq(),GK=Tl();xK(Zq,"factory",GK);Qq.exports=Zq});var $q=s(function(z9e,AK){AK.exports={dtype:"float64"}});var rb=s(function(k9e,eb){"use strict";var VK=require("@stdlib/array/typed-real-float-dtypes"),FK=require("@stdlib/assert/is-plain-object"),WK=require("@stdlib/assert/has-own-property"),Kq=require("@stdlib/string/format"),jl=VK();jl.push("generic");function IK(r,e){return FK(e)?WK(e,"dtype")&&(r.dtype=e.dtype,jl.indexOf(r.dtype)<0)?new TypeError(Kq('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",jl.join('", "'),r.dtype)):null:new TypeError(Kq("invalid argument. Options argument must be an object. Value: `%s`.",e))}eb.exports=IK});var Ml=s(function(J9e,ub){"use strict";var tb=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ys=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ib=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zK=require("@stdlib/utils/constant-function"),kK=require("@stdlib/utils/noop"),Xu=nn(),nb=require("@stdlib/array/typed-real-float-ctors"),ab=require("@stdlib/array/base/filled-by"),JK=require("@stdlib/strided/base/nullary"),UK=require("@stdlib/strided/base/binary"),sb=require("@stdlib/string/format"),CK=$q(),Du=rb();function BK(){var r,e,i,t,n,a;if(i={dtype:CK.dtype},e=arguments.length,e===0)n=Xu,t=o;else if(e===1){if(r=arguments[0],n=Xu.factory(r),a=Du(i,r),a)throw a;t=o}else if(e===2)n=Xu.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=Xu.factory(arguments[0],arguments[1],r),a=Du(i,r),a)throw a;t=u}return r&&r.prng?(ys(t,"seed",null),ys(t,"seedLength",null),ib(t,"state",zK(null),kK),ys(t,"stateLength",null),ys(t,"byteLength",null)):(Bu(t,"seed",g),Bu(t,"seedLength",f),ib(t,"state",h,y),Bu(t,"stateLength",m),Bu(t,"byteLength",c)),ys(t,"PRNG",n.PRNG),t;function u(d,l){var v,p,q,b,w;if(!tb(d))throw new TypeError(sb("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=Du(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?ab(d,n):(v=nb(b),p=new v(d),JK([p],[d],[1],n),p)}function o(d,l,v,p){var q,b,w,S,O;if(!tb(d))throw new TypeError(sb("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(O={},arguments.length>3&&(w=Du(O,p),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return ab(d,M);return q=nb(S),b=new q(d),UK([[l],[v],b],[d],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}ub.exports=BK});var gb=s(function(U9e,ob){"use strict";var XK=Ml(),DK=XK();ob.exports=DK});var db=s(function(C9e,fb){"use strict";var YK=require("@stdlib/utils/define-nonenumerable-read-only-property"),vb=gb(),HK=Ml();YK(vb,"factory",HK);fb.exports=vb});var mb=s(function(B9e,cb){"use strict";var ZK=require("@stdlib/assert/is-number").isPrimitive,QK=require("@stdlib/assert/is-positive-number").isPrimitive,lb=require("@stdlib/string/format"),$K=require("@stdlib/assert/is-nan");function KK(r,e){return!ZK(r)||$K(r)?new TypeError(lb("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):QK(e)?null:new TypeError(lb("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}cb.exports=KK});var pb=s(function(X9e,hb){"use strict";var eee=require("@stdlib/stats/base/dists/cosine/quantile");function ree(r,e,i){return eee(r(),e,i)}hb.exports=ree});var xl=s(function(D9e,Eb){"use strict";var Wr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yb=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qb=require("@stdlib/assert/is-plain-object"),bb=require("@stdlib/assert/is-function"),wb=require("@stdlib/assert/has-own-property"),Sb=require("@stdlib/utils/constant-function"),tee=require("@stdlib/utils/noop"),Hu=j().factory,Ob=require("@stdlib/math/base/assert/is-nan"),iee=require("@stdlib/array/to-json"),Zu=require("@stdlib/string/format"),nee=mb(),Nb=pb();function aee(){var r,e,i,t,n,a;if(arguments.length===0)e=Hu();else if(arguments.length===1){if(r=arguments[0],!qb(r))throw new TypeError(Zu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(wb(r,"prng")){if(!bb(r.prng))throw new TypeError(Zu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Hu(r)}else{if(n=arguments[0],a=arguments[1],t=nee(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!qb(r))throw new TypeError(Zu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(wb(r,"prng")){if(!bb(r.prng))throw new TypeError(Zu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Hu(r)}else e=Hu()}return n===void 0?i=d:i=y,Wr(i,"NAME","cosine"),r&&r.prng?(Wr(i,"seed",null),Wr(i,"seedLength",null),yb(i,"state",Sb(null),tee),Wr(i,"stateLength",null),Wr(i,"byteLength",null),Wr(i,"toJSON",Sb(null)),Wr(i,"PRNG",e)):(Yu(i,"seed",u),Yu(i,"seedLength",o),yb(i,"state",m,c),Yu(i,"stateLength",g),Yu(i,"byteLength",f),Wr(i,"toJSON",h),Wr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function f(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function h(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=iee(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return Nb(e,n,a)}function d(l,v){return Ob(l)||Ob(v)||v<=0?NaN:Nb(e,l,v)}}Eb.exports=aee});var Rb=s(function(Y9e,Lb){"use strict";var see=xl(),uee=see();Lb.exports=uee});var an=s(function(H9e,_b){"use strict";var oee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pb=Rb(),gee=xl();oee(Pb,"factory",gee);_b.exports=Pb});var Tb=s(function(Z9e,vee){vee.exports={dtype:"float64"}});var xb=s(function(Q9e,Mb){"use strict";var fee=require("@stdlib/array/typed-real-float-dtypes"),dee=require("@stdlib/assert/is-plain-object"),lee=require("@stdlib/assert/has-own-property"),jb=require("@stdlib/string/format"),Gl=fee();Gl.push("generic");function cee(r,e){return dee(e)?lee(e,"dtype")&&(r.dtype=e.dtype,Gl.indexOf(r.dtype)<0)?new TypeError(jb('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Gl.join('", "'),r.dtype)):null:new TypeError(jb("invalid argument. Options argument must be an object. Value: `%s`.",e))}Mb.exports=cee});var Al=s(function($9e,Ib){"use strict";var Gb=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qs=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ab=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),mee=require("@stdlib/utils/constant-function"),hee=require("@stdlib/utils/noop"),$u=an(),Vb=require("@stdlib/array/typed-real-float-ctors"),Fb=require("@stdlib/array/base/filled-by"),pee=require("@stdlib/strided/base/nullary"),yee=require("@stdlib/strided/base/binary"),Wb=require("@stdlib/string/format"),qee=Tb(),Ku=xb();function bee(){var r,e,i,t,n,a;if(i={dtype:qee.dtype},e=arguments.length,e===0)n=$u,t=o;else if(e===1){if(r=arguments[0],n=$u.factory(r),a=Ku(i,r),a)throw a;t=o}else if(e===2)n=$u.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=$u.factory(arguments[0],arguments[1],r),a=Ku(i,r),a)throw a;t=u}return r&&r.prng?(qs(t,"seed",null),qs(t,"seedLength",null),Ab(t,"state",mee(null),hee),qs(t,"stateLength",null),qs(t,"byteLength",null)):(Qu(t,"seed",g),Qu(t,"seedLength",f),Ab(t,"state",h,y),Qu(t,"stateLength",m),Qu(t,"byteLength",c)),qs(t,"PRNG",n.PRNG),t;function u(d,l){var v,p,q,b,w;if(!Gb(d))throw new TypeError(Wb("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=Ku(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?Fb(d,n):(v=Vb(b),p=new v(d),pee([p],[d],[1],n),p)}function o(d,l,v,p){var q,b,w,S,O;if(!Gb(d))throw new TypeError(Wb("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(O={},arguments.length>3&&(w=Ku(O,p),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return Fb(d,M);return q=Vb(S),b=new q(d),yee([[l],[v],b],[d],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}Ib.exports=bee});var kb=s(function(K9e,zb){"use strict";var wee=Al(),See=wee();zb.exports=See});var Cb=s(function(e8e,Ub){"use strict";var Oee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jb=kb(),Nee=Al();Oee(Jb,"factory",Nee);Ub.exports=Jb});var Yb=s(function(r8e,Db){"use strict";var Bb=require("@stdlib/assert/is-integer").isPrimitive,Vl=require("@stdlib/string/format"),Xb=require("@stdlib/assert/is-nan");function Eee(r,e){return!Bb(r)||Xb(r)?new TypeError(Vl("invalid argument. First argument must be an integer and not NaN. Value: `%s`.",r)):!Bb(e)||Xb(e)?new TypeError(Vl("invalid argument. Second argument must be an integer and not NaN. Value: `%s`.",e)):r>e?new RangeError(Vl("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e)):null}Db.exports=Eee});var Qb=s(function(t8e,Zb){"use strict";var Fl=require("@stdlib/constants/float64/max-safe-integer"),na=require("@stdlib/math/base/special/floor");function Hb(r,e,i){var t,n,a,u,o,g,f,m,c;if(a=i-e,a===0)return e;if(f=r.MIN,m=r.MAX,n=m-f,n===a)return r()-f+e;if(nFl/g)&&(c*=g,t+=c,!(t>a)))return t+e}for(n===Fl?(o=na(n/(a+1)),n%(a+1)===a&&(o+=1)):o=na((n+1)/(a+1));;)if(t=r()-f,t=na(t/o),t<=a)return t+e}Zb.exports=Hb});var Wl=s(function(i8e,aw){"use strict";var Ir=require("@stdlib/utils/define-nonenumerable-read-only-property"),eo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),$b=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Kb=require("@stdlib/assert/is-plain-object"),ew=require("@stdlib/assert/is-function"),rw=require("@stdlib/assert/has-own-property"),tw=require("@stdlib/utils/constant-function"),Lee=require("@stdlib/utils/noop"),ro=j().factory,iw=require("@stdlib/math/base/assert/is-nan"),aa=require("@stdlib/math/base/assert/is-integer"),Ree=require("@stdlib/array/to-json"),dt=require("@stdlib/string/format"),Pee=Yb(),nw=Qb();function _ee(){var r,e,i,t,n,a;if(arguments.length===0)e=ro();else if(arguments.length===1){if(r=arguments[0],!Kb(r))throw new TypeError(dt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(rw(r,"prng")){if(!ew(r.prng))throw new TypeError(dt("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));if(e=r.prng,!aa(e.MIN))throw new TypeError(dt("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!aa(e.MAX))throw new TypeError(dt("invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.","prng"))}else e=ro(r)}else{if(n=arguments[0],a=arguments[1],t=Pee(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!Kb(r))throw new TypeError(dt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(rw(r,"prng")){if(!ew(r.prng))throw new TypeError(dt("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));if(e=r.prng,!aa(e.MIN))throw new TypeError(dt("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!aa(e.MAX))throw new TypeError(dt("invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.","prng"))}else e=ro(r)}else e=ro()}return n===void 0?i=d:i=y,Ir(i,"NAME","discrete-uniform"),r&&r.prng?(Ir(i,"seed",null),Ir(i,"seedLength",null),$b(i,"state",tw(null),Lee),Ir(i,"stateLength",null),Ir(i,"byteLength",null),Ir(i,"toJSON",tw(null)),Ir(i,"PRNG",e)):(eo(i,"seed",u),eo(i,"seedLength",o),$b(i,"state",m,c),eo(i,"stateLength",g),eo(i,"byteLength",f),Ir(i,"toJSON",h),Ir(i,"PRNG",e)),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function f(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function h(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=Ree(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return nw(e,n,a)}function d(l,v){return iw(l)||iw(v)||!aa(l)||!aa(v)||l>v?NaN:nw(e,l,v)}}aw.exports=_ee});var uw=s(function(n8e,sw){"use strict";var Tee=Wl(),jee=Tee();sw.exports=jee});var sn=s(function(a8e,gw){"use strict";var Mee=require("@stdlib/utils/define-nonenumerable-read-only-property"),ow=uw(),xee=Wl();Mee(ow,"factory",xee);gw.exports=ow});var vw=s(function(s8e,Gee){Gee.exports={dtype:"float64"}});var lw=s(function(u8e,dw){"use strict";var Aee=require("@stdlib/array/typed-real-dtypes"),Vee=require("@stdlib/assert/is-plain-object"),Fee=require("@stdlib/assert/has-own-property"),fw=require("@stdlib/string/format"),Il=Aee();Il.push("generic");function Wee(r,e){return Vee(e)?Fee(e,"dtype")&&(r.dtype=e.dtype,Il.indexOf(r.dtype)<0)?new TypeError(fw('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Il.join('", "'),r.dtype)):null:new TypeError(fw("invalid argument. Options argument must be an object. Value: `%s`.",e))}dw.exports=Wee});var zl=s(function(o8e,qw){"use strict";var cw=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bs=require("@stdlib/utils/define-nonenumerable-read-only-property"),to=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),mw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Iee=require("@stdlib/utils/constant-function"),zee=require("@stdlib/utils/noop"),io=sn(),hw=require("@stdlib/array/typed-real-ctors"),pw=require("@stdlib/array/base/filled-by"),kee=require("@stdlib/strided/base/nullary"),Jee=require("@stdlib/strided/base/binary"),yw=require("@stdlib/string/format"),Uee=vw(),no=lw();function Cee(){var r,e,i,t,n,a;if(i={dtype:Uee.dtype},e=arguments.length,e===0)n=io,t=o;else if(e===1){if(r=arguments[0],n=io.factory(r),a=no(i,r),a)throw a;t=o}else if(e===2)n=io.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=io.factory(arguments[0],arguments[1],r),a=no(i,r),a)throw a;t=u}return r&&r.prng?(bs(t,"seed",null),bs(t,"seedLength",null),mw(t,"state",Iee(null),zee),bs(t,"stateLength",null),bs(t,"byteLength",null)):(to(t,"seed",g),to(t,"seedLength",f),mw(t,"state",h,y),to(t,"stateLength",m),to(t,"byteLength",c)),bs(t,"PRNG",n.PRNG),t;function u(d,l){var v,p,q,b,w;if(!cw(d))throw new TypeError(yw("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=no(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?pw(d,n):(v=hw(b),p=new v(d),kee([p],[d],[1],n),p)}function o(d,l,v,p){var q,b,w,S,O;if(!cw(d))throw new TypeError(yw("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(O={},arguments.length>3&&(w=no(O,p),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return pw(d,M);return q=hw(S),b=new q(d),Jee([[l],[v],b],[d],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}qw.exports=Cee});var ww=s(function(g8e,bw){"use strict";var Bee=zl(),Xee=Bee();bw.exports=Xee});var Nw=s(function(v8e,Ow){"use strict";var Dee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sw=ww(),Yee=zl();Dee(Sw,"factory",Yee);Ow.exports=Sw});var Rw=s(function(f8e,Lw){"use strict";var Hee=require("@stdlib/assert/is-plain-object"),Zee=require("@stdlib/assert/has-own-property"),Qee=require("@stdlib/array/base/assert/contains"),Ew=require("@stdlib/string/format");function $ee(r,e,i){return Hee(i)?Zee(i,"dtype")&&(r.dtype=i.dtype,!Qee(e,r.dtype))?new TypeError(Ew('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(Ew("invalid argument. Options argument must be an object. Value: `%s`.",i))}Lw.exports=$ee});var jw=s(function(d8e,Tw){"use strict";var Pw=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kee=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ere=require("@stdlib/assert/is-function"),rre=require("@stdlib/assert/is-string-array").primitives,tre=require("@stdlib/assert/is-collection"),ire=require("@stdlib/array/base/assert/contains"),nre=require("@stdlib/array/base/filled-by"),_w=require("@stdlib/strided/base/unary"),are=require("@stdlib/array/ctors"),ws=require("@stdlib/string/format"),sre=Rw();function Ss(r,e,i){if(!(this instanceof Ss))return new Ss(r,e,i);if(!ere(r))throw new TypeError(ws("invalid argument. First argument must be a function. Value: `%s`.",r));if(!rre(e))throw new TypeError(ws("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!ire(e,i))throw new TypeError(ws("invalid argument. Third argument must be a supported data type. Value: `%s`.",i));return this._prng=r,this._dtypes=e,this._dtype=i,this}Pw(Ss.prototype,"generate",function(e,i,t){var n,a,u,o,g,f;if(!Kee(e))throw new TypeError(ws("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(a={},arguments.length>2&&(g=sre(a,this._dtypes,t),g))throw g;if(u=this._prng,f=a.dtype||this._dtype,f==="generic")return nre(e,m);return n=are(f),o=new n(e),_w([[i],o],[e],[0,1],u),o;function m(){return u(i)}});Pw(Ss.prototype,"assign",function(e,i){if(!tre(i))throw new TypeError(ws("invalid argument. Second argument must be an array-like object. Value: `%s`.",i));return _w([[e],i],[i.length],[0,1],this._prng),i});Tw.exports=Ss});var xw=s(function(l8e,Mw){"use strict";var ure=jw();Mw.exports=ure});var Vw=s(function(c8e,Aw){"use strict";var ore=require("@stdlib/assert/is-plain-object"),gre=require("@stdlib/assert/has-own-property"),vre=require("@stdlib/array/base/assert/contains"),Gw=require("@stdlib/string/format");function fre(r,e,i){return ore(i)?gre(i,"dtype")&&(r.dtype=i.dtype,!vre(e,r.dtype))?new TypeError(Gw('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(Gw("invalid argument. Options argument must be an object. Value: `%s`.",i))}Aw.exports=fre});var zw=s(function(m8e,Iw){"use strict";var Fw=require("@stdlib/utils/define-nonenumerable-read-only-property"),dre=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,lre=require("@stdlib/assert/is-function"),cre=require("@stdlib/assert/is-string-array").primitives,mre=require("@stdlib/assert/is-collection"),hre=require("@stdlib/array/base/assert/contains"),pre=require("@stdlib/array/base/filled-by"),Ww=require("@stdlib/strided/base/nullary"),yre=require("@stdlib/array/ctors"),Os=require("@stdlib/string/format"),qre=Vw();function Ns(r,e,i){if(!(this instanceof Ns))return new Ns(r,e,i);if(!lre(r))throw new TypeError(Os("invalid argument. First argument must be a function. Value: `%s`.",r));if(!cre(e))throw new TypeError(Os("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!hre(e,i))throw new TypeError(Os("invalid argument. Third argument must be a supported data type. Value: `%s`.",i));return this._prng=r,this._dtypes=e,this._dtype=i,this}Fw(Ns.prototype,"generate",function(e,i){var t,n,a,u,o;if(!dre(e))throw new TypeError(Os("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(n={},arguments.length>1&&(u=qre(n,this._dtypes,i),u))throw u;return o=n.dtype||this._dtype,o==="generic"?pre(e,this._prng):(t=yre(o),a=new t(e),Ww([a],[e],[1],this._prng),a)});Fw(Ns.prototype,"assign",function(e){if(!mre(e))throw new TypeError(Os("invalid argument. First argument must be an array-like object. Value: `%s`.",e));return Ww([e],[e.length],[1],this._prng),e});Iw.exports=Ns});var Jw=s(function(h8e,kw){"use strict";var bre=zw();kw.exports=bre});var Xw=s(function(p8e,Bw){"use strict";var Uw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ao=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sa=require("@stdlib/utils/define-nonenumerable-read-only-property"),wre=require("@stdlib/assert/is-string-array").primitives,Sre=require("@stdlib/assert/is-function"),Ore=require("@stdlib/assert/is-method-in"),Nre=require("@stdlib/assert/is-plain-object"),Ere=require("@stdlib/assert/has-own-property"),Cw=require("@stdlib/array/base/assert/contains").factory,Lre=require("@stdlib/utils/constant-function"),Rre=require("@stdlib/utils/noop"),Pre=xw(),_re=Jw(),Es=require("@stdlib/string/format");function Tre(r,e,i){var t;if(!Sre(r))throw new TypeError(Es("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Ore(r,"factory"))throw new TypeError(Es("invalid argument. First argument must have a `%s` method.","factory"));if(!wre(e))throw new TypeError(Es("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!Cw(e,i))throw new TypeError(Es("invalid argument. Third argument must be a supported data type. Value: `%s`.",i));return t=Cw(e),n;function n(){var a,u,o,g,f,m,c,h,y;if(f=arguments.length,f<1?(c={},m=r,h=d):f>1?(o=arguments[0],c=arguments[1],m=r.factory(o,c),h=l):Nre(arguments[0])?(c=arguments[0],m=r.factory(c),h=d):(o=arguments[0],c={},m=r.factory(o),h=l),Ere(c,"dtype")){if(y=c.dtype,!t(y))throw new TypeError(Es('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),y))}else y=i;return h===d?(g=v,a=Pre):(g=p,a=_re),u=new a(m,e,y),c&&c.prng?(sa(h,"seed",null),sa(h,"seedLength",null),Uw(h,"state",Lre(null),Rre),sa(h,"stateLength",null),sa(h,"byteLength",null)):(ao(h,"seed",q),ao(h,"seedLength",b),Uw(h,"state",O,M),ao(h,"stateLength",w),ao(h,"byteLength",S)),sa(h,"PRNG",m.PRNG),sa(h,"assign",g),h;function d(x,Ce,Y){return arguments.length<3?u.generate(x,Ce):u.generate(x,Ce,Y)}function l(x,Ce){return arguments.length<2?u.generate(x):u.generate(x,Ce)}function v(x,Ce){return u.assign(x,Ce)}function p(x){return u.assign(x)}function q(){return h.PRNG.seed}function b(){return h.PRNG.seedLength}function w(){return h.PRNG.stateLength}function S(){return h.PRNG.byteLength}function O(){return h.PRNG.state}function M(x){h.PRNG.state=x}}}Bw.exports=Tre});var kl=s(function(y8e,Dw){"use strict";var jre=Xw();Dw.exports=jre});var Hw=s(function(q8e,Yw){"use strict";var Mre=require("@stdlib/math/base/special/ln");function xre(r,e){return-Mre(1-r())/e}Yw.exports=xre});var Jl=s(function(b8e,tS){"use strict";var zr=require("@stdlib/utils/define-nonenumerable-read-only-property"),so=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Zw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Gre=require("@stdlib/assert/is-positive-number").isPrimitive,Qw=require("@stdlib/assert/is-plain-object"),$w=require("@stdlib/assert/is-function"),Kw=require("@stdlib/assert/has-own-property"),eS=require("@stdlib/utils/constant-function"),Are=require("@stdlib/utils/noop"),uo=j().factory,Vre=require("@stdlib/math/base/assert/is-nan"),Fre=require("@stdlib/array/to-json"),oo=require("@stdlib/string/format"),rS=Hw();function Wre(){var r,e,i,t;if(arguments.length===0)i=uo();else if(arguments.length===1&&Qw(arguments[0]))if(e=arguments[0],Kw(e,"prng")){if(!$w(e.prng))throw new TypeError(oo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=uo(e);else{if(r=arguments[0],!Gre(r))throw new TypeError(oo("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!Qw(e))throw new TypeError(oo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(Kw(e,"prng")){if(!$w(e.prng))throw new TypeError(oo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=uo(e)}else i=uo()}return r===void 0?t=h:t=c,zr(t,"NAME","exponential"),e&&e.prng?(zr(t,"seed",null),zr(t,"seedLength",null),Zw(t,"state",eS(null),Are),zr(t,"stateLength",null),zr(t,"byteLength",null),zr(t,"toJSON",eS(null)),zr(t,"PRNG",i)):(so(t,"seed",n),so(t,"seedLength",a),Zw(t,"state",g,f),so(t,"stateLength",u),so(t,"byteLength",o),zr(t,"toJSON",m),zr(t,"PRNG",i),i=i.normalized),t;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function f(y){i.state=y}function m(){var y={};return y.type="PRNG",y.name=t.NAME,y.state=Fre(i.state),r===void 0?y.params=[]:y.params=[r],y}function c(){return rS(i,r)}function h(y){return Vre(y)||y<=0?NaN:rS(i,y)}}tS.exports=Wre});var nS=s(function(w8e,iS){"use strict";var Ire=Jl(),zre=Ire();iS.exports=zre});var un=s(function(S8e,sS){"use strict";var kre=require("@stdlib/utils/define-nonenumerable-read-only-property"),aS=nS(),Jre=Jl();kre(aS,"factory",Jre);sS.exports=aS});var Ul=s(function(O8e,uS){"use strict";var Ure=kl(),Cre=require("@stdlib/array/dtypes"),Bre=require("@stdlib/array/defaults"),Xre=un(),Dre=Cre("real_floating_point_and_generic"),Yre=Ure(Xre,Dre,Bre.get("dtypes.real_floating_point"));uS.exports=Yre});var gS=s(function(N8e,oS){"use strict";var Hre=Ul(),Zre=Hre();oS.exports=Zre});var dS=s(function(E8e,fS){"use strict";var Qre=require("@stdlib/utils/define-nonenumerable-read-only-property"),vS=gS(),$re=Ul();Qre(vS,"factory",$re);fS.exports=vS});var lS=s(function(L8e,Kre){Kre.exports={dtype:"float64"}});var hS=s(function(R8e,mS){"use strict";var ete=require("@stdlib/array/typed-real-float-dtypes"),rte=require("@stdlib/assert/is-plain-object"),tte=require("@stdlib/assert/has-own-property"),cS=require("@stdlib/string/format"),Cl=ete();Cl.push("generic");function ite(r,e){return rte(e)?tte(e,"dtype")&&(r.dtype=e.dtype,Cl.indexOf(r.dtype)<0)?new TypeError(cS('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Cl.join('", "'),r.dtype)):null:new TypeError(cS("invalid argument. Options argument must be an object. Value: `%s`.",e))}mS.exports=ite});var Bl=s(function(P8e,SS){"use strict";var pS=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ls=require("@stdlib/utils/define-nonenumerable-read-only-property"),go=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nte=require("@stdlib/utils/constant-function"),ate=require("@stdlib/utils/noop"),vo=ke(),qS=require("@stdlib/array/typed-real-float-ctors"),bS=require("@stdlib/array/base/filled-by"),ste=require("@stdlib/strided/base/nullary"),ute=require("@stdlib/strided/base/binary"),wS=require("@stdlib/string/format"),ote=lS(),fo=hS();function gte(){var r,e,i,t,n,a;if(i={dtype:ote.dtype},e=arguments.length,e===0)n=vo,t=o;else if(e===1){if(r=arguments[0],n=vo.factory(r),a=fo(i,r),a)throw a;t=o}else if(e===2)n=vo.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=vo.factory(arguments[0],arguments[1],r),a=fo(i,r),a)throw a;t=u}return r&&r.prng?(Ls(t,"seed",null),Ls(t,"seedLength",null),yS(t,"state",nte(null),ate),Ls(t,"stateLength",null),Ls(t,"byteLength",null)):(go(t,"seed",g),go(t,"seedLength",f),yS(t,"state",h,y),go(t,"stateLength",m),go(t,"byteLength",c)),Ls(t,"PRNG",n.PRNG),t;function u(d,l){var v,p,q,b,w;if(!pS(d))throw new TypeError(wS("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=fo(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?bS(d,n):(v=qS(b),p=new v(d),ste([p],[d],[1],n),p)}function o(d,l,v,p){var q,b,w,S,O;if(!pS(d))throw new TypeError(wS("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(O={},arguments.length>3&&(w=fo(O,p),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return bS(d,M);return q=qS(S),b=new q(d),ute([[l],[v],b],[d],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}SS.exports=gte});var NS=s(function(_8e,OS){"use strict";var vte=Bl(),fte=vte();OS.exports=fte});var RS=s(function(T8e,LS){"use strict";var dte=require("@stdlib/utils/define-nonenumerable-read-only-property"),ES=NS(),lte=Bl();dte(ES,"factory",lte);LS.exports=ES});var TS=s(function(j8e,_S){"use strict";var cte=require("@stdlib/math/base/special/floor"),PS=require("@stdlib/math/base/special/ln");function mte(r,e){var i=r();return i===0&&(i=r()),cte(PS(i)/PS(1-e))}_S.exports=mte});var Xl=s(function(M8e,FS){"use strict";var kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),lo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),jS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),MS=require("@stdlib/assert/is-plain-object"),hte=require("@stdlib/assert/is-probability").isPrimitive,xS=require("@stdlib/assert/is-function"),GS=require("@stdlib/assert/has-own-property"),AS=require("@stdlib/utils/constant-function"),pte=require("@stdlib/utils/noop"),co=j().factory,yte=require("@stdlib/math/base/assert/is-nan"),qte=require("@stdlib/array/to-json"),mo=require("@stdlib/string/format"),VS=TS();function bte(){var r,e,i,t;if(arguments.length===0)e=co();else if(arguments.length===1&&MS(arguments[0]))if(r=arguments[0],GS(r,"prng")){if(!xS(r.prng))throw new TypeError(mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=co(r);else{if(t=arguments[0],!hte(t))throw new TypeError(mo("invalid argument. First argument must be a probability. Value: `%s`.",t));if(arguments.length>1){if(r=arguments[1],!MS(r))throw new TypeError(mo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(GS(r,"prng")){if(!xS(r.prng))throw new TypeError(mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=co(r)}else e=co()}return t===void 0?i=h:i=c,kr(i,"NAME","geometric"),r&&r.prng?(kr(i,"seed",null),kr(i,"seedLength",null),jS(i,"state",AS(null),pte),kr(i,"stateLength",null),kr(i,"byteLength",null),kr(i,"toJSON",AS(null)),kr(i,"PRNG",e)):(lo(i,"seed",n),lo(i,"seedLength",a),jS(i,"state",g,f),lo(i,"stateLength",u),lo(i,"byteLength",o),kr(i,"toJSON",m),kr(i,"PRNG",e),e=e.normalized),i;function n(){return e.seed}function a(){return e.seedLength}function u(){return e.stateLength}function o(){return e.byteLength}function g(){return e.state}function f(y){e.state=y}function m(){var y={};return y.type="PRNG",y.name=i.NAME,y.state=qte(e.state),t===void 0?y.params=[]:y.params=[t],y}function c(){return VS(e,t)}function h(y){return yte(y)||y<0||y>1?NaN:VS(e,y)}}FS.exports=bte});var IS=s(function(x8e,WS){"use strict";var wte=Xl(),Ste=wte();WS.exports=Ste});var ua=s(function(G8e,kS){"use strict";var Ote=require("@stdlib/utils/define-nonenumerable-read-only-property"),zS=IS(),Nte=Xl();Ote(zS,"factory",Nte);kS.exports=zS});var Dl=s(function(A8e,JS){"use strict";var Ete=kl(),Lte=require("@stdlib/array/dtypes"),Rte=require("@stdlib/array/defaults"),Pte=ua(),_te=Lte("real_and_generic"),Tte=Ete(Pte,_te,Rte.get("dtypes.real"));JS.exports=Tte});var CS=s(function(V8e,US){"use strict";var jte=Dl(),Mte=jte();US.exports=Mte});var DS=s(function(F8e,XS){"use strict";var xte=require("@stdlib/utils/define-nonenumerable-read-only-property"),BS=CS(),Gte=Dl();xte(BS,"factory",Gte);XS.exports=BS});var QS=s(function(W8e,ZS){"use strict";var YS=require("@stdlib/assert/is-positive-number").isPrimitive,HS=require("@stdlib/string/format");function Ate(r,e){return YS(r)?YS(e)?null:new TypeError(HS("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(HS("invalid argument. First argument must be a positive number. Value: `%s`.",r))}ZS.exports=Ate});var Yl=s(function(I8e,nO){"use strict";var lt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ho=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),$S=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),KS=require("@stdlib/assert/is-plain-object"),eO=require("@stdlib/assert/is-function"),rO=require("@stdlib/assert/has-own-property"),tO=require("@stdlib/utils/constant-function"),Vte=require("@stdlib/utils/noop"),oa=ke().factory,iO=require("@stdlib/math/base/assert/is-nan"),Fte=require("@stdlib/array/to-json"),po=require("@stdlib/string/format"),Wte=QS();function Ite(){var r,e,i,t,n,a,u;if(arguments.length===0)r=oa();else if(arguments.length===1){if(t=arguments[0],!KS(t))throw new TypeError(po("invalid argument. Options argument must be an object. Value: `%s`.",t));if(rO(t,"prng")){if(!eO(t.prng))throw new TypeError(po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=oa({prng:t.prng})}else r=oa(t)}else{if(e=arguments[0],i=arguments[1],u=Wte(e,i),u)throw u;if(arguments.length>2){if(t=arguments[2],!KS(t))throw new TypeError(po("invalid argument. Options argument must be an object. Value: `%s`.",t));if(rO(t,"prng")){if(!eO(t.prng))throw new TypeError(po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=oa(e,i,{prng:t.prng})}else r=oa(e,i,t)}else r=oa(e,i)}return e===void 0?a=l:a=d,n=r.PRNG,lt(a,"NAME","invgamma"),t&&t.prng?(lt(a,"seed",null),lt(a,"seedLength",null),$S(a,"state",tO(null),Vte),lt(a,"stateLength",null),lt(a,"byteLength",null),lt(a,"toJSON",tO(null))):(ho(a,"seed",o),ho(a,"seedLength",g),$S(a,"state",c,h),ho(a,"stateLength",f),ho(a,"byteLength",m),lt(a,"toJSON",y)),lt(a,"PRNG",n),a;function o(){return n.seed}function g(){return n.seedLength}function f(){return n.stateLength}function m(){return n.byteLength}function c(){return n.state}function h(v){n.state=v}function y(){var v={};return v.type="PRNG",v.name=a.NAME,v.state=Fte(n.state),e===void 0?v.params=[]:v.params=[e,i],v}function d(){return 1/r()}function l(v,p){return iO(v)||iO(p)||v<=0||p<=0?NaN:1/r(v,p)}}nO.exports=Ite});var sO=s(function(z8e,aO){"use strict";var zte=Yl(),kte=zte();aO.exports=kte});var on=s(function(k8e,oO){"use strict";var Jte=require("@stdlib/utils/define-nonenumerable-read-only-property"),uO=sO(),Ute=Yl();Jte(uO,"factory",Ute);oO.exports=uO});var gO=s(function(J8e,Cte){Cte.exports={dtype:"float64"}});var dO=s(function(U8e,fO){"use strict";var Bte=require("@stdlib/array/typed-real-float-dtypes"),Xte=require("@stdlib/assert/is-plain-object"),Dte=require("@stdlib/assert/has-own-property"),vO=require("@stdlib/string/format"),Hl=Bte();Hl.push("generic");function Yte(r,e){return Xte(e)?Dte(e,"dtype")&&(r.dtype=e.dtype,Hl.indexOf(r.dtype)<0)?new TypeError(vO('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Hl.join('", "'),r.dtype)):null:new TypeError(vO("invalid argument. Options argument must be an object. Value: `%s`.",e))}fO.exports=Yte});var Zl=s(function(C8e,yO){"use strict";var lO=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rs=require("@stdlib/utils/define-nonenumerable-read-only-property"),yo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Hte=require("@stdlib/utils/constant-function"),Zte=require("@stdlib/utils/noop"),qo=on(),mO=require("@stdlib/array/typed-real-float-ctors"),hO=require("@stdlib/array/base/filled-by"),Qte=require("@stdlib/strided/base/nullary"),$te=require("@stdlib/strided/base/binary"),pO=require("@stdlib/string/format"),Kte=gO(),bo=dO();function eie(){var r,e,i,t,n,a;if(i={dtype:Kte.dtype},e=arguments.length,e===0)n=qo,t=o;else if(e===1){if(r=arguments[0],n=qo.factory(r),a=bo(i,r),a)throw a;t=o}else if(e===2)n=qo.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=qo.factory(arguments[0],arguments[1],r),a=bo(i,r),a)throw a;t=u}return r&&r.prng?(Rs(t,"seed",null),Rs(t,"seedLength",null),cO(t,"state",Hte(null),Zte),Rs(t,"stateLength",null),Rs(t,"byteLength",null)):(yo(t,"seed",g),yo(t,"seedLength",f),cO(t,"state",h,y),yo(t,"stateLength",m),yo(t,"byteLength",c)),Rs(t,"PRNG",n.PRNG),t;function u(d,l){var v,p,q,b,w;if(!lO(d))throw new TypeError(pO("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=bo(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?hO(d,n):(v=mO(b),p=new v(d),Qte([p],[d],[1],n),p)}function o(d,l,v,p){var q,b,w,S,O;if(!lO(d))throw new TypeError(pO("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(O={},arguments.length>3&&(w=bo(O,p),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return hO(d,M);return q=mO(S),b=new q(d),$te([[l],[v],b],[d],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}yO.exports=eie});var bO=s(function(B8e,qO){"use strict";var rie=Zl(),tie=rie();qO.exports=tie});var OO=s(function(X8e,SO){"use strict";var iie=require("@stdlib/utils/define-nonenumerable-read-only-property"),wO=bO(),nie=Zl();iie(wO,"factory",nie);SO.exports=wO});var LO=s(function(D8e,EO){"use strict";var aie=require("@stdlib/assert/is-number").isPrimitive,sie=require("@stdlib/assert/is-positive-number").isPrimitive,NO=require("@stdlib/string/format"),uie=require("@stdlib/assert/is-nan");function oie(r,e){return!aie(r)||uie(r)?new TypeError(NO("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):sie(e)?null:new TypeError(NO("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}EO.exports=oie});var PO=s(function(Y8e,RO){"use strict";var gie=require("@stdlib/math/base/special/exp");function vie(r,e,i){return gie(e+i*r())}RO.exports=vie});var Ql=s(function(H8e,VO){"use strict";var ct=require("@stdlib/utils/define-nonenumerable-read-only-property"),wo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_O=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),TO=require("@stdlib/assert/is-plain-object"),jO=require("@stdlib/assert/is-function"),MO=require("@stdlib/assert/has-own-property"),xO=require("@stdlib/utils/constant-function"),fie=require("@stdlib/utils/noop"),ga=H().factory,GO=require("@stdlib/math/base/assert/is-nan"),die=require("@stdlib/array/to-json"),So=require("@stdlib/string/format"),lie=LO(),AO=PO();function cie(){var r,e,i,t,n,a,u;if(arguments.length===0)e=ga();else if(arguments.length===1){if(i=arguments[0],!TO(i))throw new TypeError(So("invalid argument. Options argument must be an object. Value: `%s`.",i));if(MO(i,"prng")){if(!jO(i.prng))throw new TypeError(So("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=ga({prng:i.prng})}else e=ga(i)}else{if(u=arguments[0],r=arguments[1],a=lie(u,r),a)throw a;if(arguments.length>2){if(i=arguments[2],!TO(i))throw new TypeError(So("invalid argument. Options argument must be an object. Value: `%s`.",i));if(MO(i,"prng")){if(!jO(i.prng))throw new TypeError(So("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=ga({prng:i.prng})}else e=ga(i)}else e=ga()}return u===void 0?n=l:n=d,t=e.PRNG,ct(n,"NAME","lognormal"),i&&i.prng?(ct(n,"seed",null),ct(n,"seedLength",null),_O(n,"state",xO(null),fie),ct(n,"stateLength",null),ct(n,"byteLength",null),ct(n,"toJSON",xO(null))):(wo(n,"seed",o),wo(n,"seedLength",g),_O(n,"state",c,h),wo(n,"stateLength",f),wo(n,"byteLength",m),ct(n,"toJSON",y)),ct(n,"PRNG",t),n;function o(){return t.seed}function g(){return t.seedLength}function f(){return t.stateLength}function m(){return t.byteLength}function c(){return t.state}function h(v){t.state=v}function y(){var v={};return v.type="PRNG",v.name=n.NAME,v.state=die(t.state),u===void 0?v.params=[]:v.params=[u,r],v}function d(){return AO(e,u,r)}function l(v,p){return GO(v)||GO(p)||p<=0?NaN:AO(e,v,p)}}VO.exports=cie});var WO=s(function(Z8e,FO){"use strict";var mie=Ql(),hie=mie();FO.exports=hie});var gn=s(function(Q8e,zO){"use strict";var pie=require("@stdlib/utils/define-nonenumerable-read-only-property"),IO=WO(),yie=Ql();pie(IO,"factory",yie);zO.exports=IO});var kO=s(function($8e,qie){qie.exports={dtype:"float64"}});var CO=s(function(K8e,UO){"use strict";var bie=require("@stdlib/array/typed-real-float-dtypes"),wie=require("@stdlib/assert/is-plain-object"),Sie=require("@stdlib/assert/has-own-property"),JO=require("@stdlib/string/format"),$l=bie();$l.push("generic");function Oie(r,e){return wie(e)?Sie(e,"dtype")&&(r.dtype=e.dtype,$l.indexOf(r.dtype)<0)?new TypeError(JO('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",$l.join('", "'),r.dtype)):null:new TypeError(JO("invalid argument. Options argument must be an object. Value: `%s`.",e))}UO.exports=Oie});var Kl=s(function(eXe,ZO){"use strict";var BO=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ps=require("@stdlib/utils/define-nonenumerable-read-only-property"),Oo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),XO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Nie=require("@stdlib/utils/constant-function"),Eie=require("@stdlib/utils/noop"),No=gn(),DO=require("@stdlib/array/typed-real-float-ctors"),YO=require("@stdlib/array/base/filled-by"),Lie=require("@stdlib/strided/base/nullary"),Rie=require("@stdlib/strided/base/binary"),HO=require("@stdlib/string/format"),Pie=kO(),Eo=CO();function _ie(){var r,e,i,t,n,a;if(i={dtype:Pie.dtype},e=arguments.length,e===0)n=No,t=o;else if(e===1){if(r=arguments[0],n=No.factory(r),a=Eo(i,r),a)throw a;t=o}else if(e===2)n=No.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=No.factory(arguments[0],arguments[1],r),a=Eo(i,r),a)throw a;t=u}return r&&r.prng?(Ps(t,"seed",null),Ps(t,"seedLength",null),XO(t,"state",Nie(null),Eie),Ps(t,"stateLength",null),Ps(t,"byteLength",null)):(Oo(t,"seed",g),Oo(t,"seedLength",f),XO(t,"state",h,y),Oo(t,"stateLength",m),Oo(t,"byteLength",c)),Ps(t,"PRNG",n.PRNG),t;function u(d,l){var v,p,q,b,w;if(!BO(d))throw new TypeError(HO("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=Eo(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?YO(d,n):(v=DO(b),p=new v(d),Lie([p],[d],[1],n),p)}function o(d,l,v,p){var q,b,w,S,O;if(!BO(d))throw new TypeError(HO("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(O={},arguments.length>3&&(w=Eo(O,p),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return YO(d,M);return q=DO(S),b=new q(d),Rie([[l],[v],b],[d],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}ZO.exports=_ie});var $O=s(function(rXe,QO){"use strict";var Tie=Kl(),jie=Tie();QO.exports=jie});var rN=s(function(tXe,eN){"use strict";var Mie=require("@stdlib/utils/define-nonenumerable-read-only-property"),KO=$O(),xie=Kl();Mie(KO,"factory",xie);eN.exports=KO});var ec=s(function(iXe,tN){"use strict";var Gie=require("@stdlib/constants/int32/max"),Aie=require("@stdlib/math/base/special/floor"),Vie=Gie-1;function Fie(){var r=Aie(1+Vie*Math.random());return r|0}tN.exports=Fie});var ic=s(function(nXe,uN){"use strict";var Jr=require("@stdlib/utils/define-nonenumerable-read-only-property"),mt=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),iN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rc=require("@stdlib/assert/has-own-property"),Wie=require("@stdlib/assert/is-plain-object"),Iie=require("@stdlib/assert/is-boolean").isPrimitive,zie=require("@stdlib/assert/is-collection"),kie=require("@stdlib/assert/is-positive-integer").isPrimitive,nN=require("@stdlib/assert/is-int32array"),Je=require("@stdlib/string/format"),Lo=require("@stdlib/constants/int32/max"),U=require("@stdlib/array/int32"),va=require("@stdlib/blas/base/gcopy"),Jie=require("@stdlib/array/to-json"),aN=ec(),tc=Lo-1|0,Uie=Lo-1|0,Cie=16807,Ro=1,Po=2,ht=2,C=4,_s=5;function sN(r,e){var i;return e?i="option":i="argument",r.length<_s+1?new RangeError(Je("invalid %s. State array has insufficient length.",i)):r[0]!==Ro?new RangeError(Je("invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.",i,Ro,r[0])):r[1]!==Po?new RangeError(Je("invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.",i,Po,r[1])):r[ht]!==1?new RangeError(Je("invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.",i,1,r[ht])):r[C]!==r.length-_s?new RangeError(Je("invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.",i,r.length-_s,r[C])):null}function Bie(r){var e,i,t,n,a,u;if(t={},arguments.length){if(!Wie(r))throw new TypeError(Je("invalid argument. Options argument must be an object. Value: `%s`.",r));if(rc(r,"copy")&&(t.copy=r.copy,!Iie(r.copy)))throw new TypeError(Je("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(rc(r,"state")){if(i=r.state,t.state=!0,!nN(i))throw new TypeError(Je("invalid option. `%s` option must be an Int32Array. Option: `%s`.","state",i));if(u=sN(i,!0),u)throw u;t.copy===!1?e=i:(e=new U(i.length),va(i.length,i,1,e,1)),i=new U(e.buffer,e.byteOffset+(ht+1)*e.BYTES_PER_ELEMENT,1),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,i[C])}if(n===void 0)if(rc(r,"seed"))if(n=r.seed,t.seed=!0,kie(n)){if(n>Uie)throw new RangeError(Je("invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.","seed",n));n|=0}else if(zie(n)&&n.length>0)a=n.length,e=new U(_s+a),e[0]=Ro,e[1]=Po,e[ht]=1,e[C]=a,va.ndarray(a,n,1,0,e,1,C+1),i=new U(e.buffer,e.byteOffset+(ht+1)*e.BYTES_PER_ELEMENT,1),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,a),i[0]=n[0];else throw new TypeError(Je("invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.","seed",n));else n=aN()|0}else n=aN()|0;return i===void 0&&(e=new U(_s+1),e[0]=Ro,e[1]=Po,e[ht]=1,e[C]=1,e[C+1]=n,i=new U(e.buffer,e.byteOffset+(ht+1)*e.BYTES_PER_ELEMENT,1),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,1),i[0]=n[0]),Jr(d,"NAME","minstd"),mt(d,"seed",o),mt(d,"seedLength",g),iN(d,"state",c,h),mt(d,"stateLength",f),mt(d,"byteLength",m),Jr(d,"toJSON",y),Jr(d,"MIN",1),Jr(d,"MAX",Lo-1),Jr(d,"normalized",l),Jr(l,"NAME",d.NAME),mt(l,"seed",o),mt(l,"seedLength",g),iN(l,"state",c,h),mt(l,"stateLength",f),mt(l,"byteLength",m),Jr(l,"toJSON",y),Jr(l,"MIN",(d.MIN-1)/tc),Jr(l,"MAX",(d.MAX-1)/tc),d;function o(){var v=e[C];return va(v,n,1,new U(v),1)}function g(){return e[C]}function f(){return e.length}function m(){return e.byteLength}function c(){var v=e.length;return va(v,e,1,new U(v),1)}function h(v){var p;if(!nN(v))throw new TypeError(Je("invalid argument. Must provide an Int32Array. Value: `%s`.",v));if(p=sN(v,!1),p)throw p;t.copy===!1?t.state&&v.length===e.length?va(v.length,v,1,e,1):(e=v,t.state=!0):(v.length!==e.length&&(e=new U(v.length)),va(v.length,v,1,e,1)),i=new U(e.buffer,e.byteOffset+(ht+1)*e.BYTES_PER_ELEMENT,1),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,e[C])}function y(){var v={};return v.type="PRNG",v.name=d.NAME,v.state=Jie(e),v.params=[],v}function d(){var v=i[0]|0;return v=Cie*v%Lo|0,i[0]=v,v|0}function l(){return(d()-1)/tc}}uN.exports=Bie});var gN=s(function(aXe,oN){"use strict";var Xie=ic(),Die=ec(),Yie=Xie({seed:Die()});oN.exports=Yie});var Z=s(function(sXe,fN){"use strict";var Hie=require("@stdlib/utils/define-nonenumerable-read-only-property"),vN=gN(),Zie=ic();Hie(vN,"factory",Zie);fN.exports=vN});var dN=s(function(uXe,Qie){Qie.exports={idtype:"float64",ndtype:"float64"}});var cN=s(function(oXe,lN){"use strict";var $ie=require("@stdlib/array/typed-real-float-dtypes"),Kie=require("@stdlib/array/typed-real-dtypes"),ene=require("@stdlib/assert/is-plain-object"),_o=require("@stdlib/assert/has-own-property"),Ts=require("@stdlib/string/format"),js=Kie(),Ms=$ie();js.push("generic");Ms.push("generic");function rne(r,e,i){if(!ene(e))return new TypeError(Ts("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i===0){if(_o(e,"idtype")&&(r.idtype=e.idtype,js.indexOf(r.idtype)<0))return new TypeError(Ts('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",js.join('", "'),r.idtype));if(_o(e,"ndtype")&&(r.ndtype=e.ndtype,Ms.indexOf(r.ndtype)<0))return new TypeError(Ts('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",Ms.join('", "'),r.ndtype))}else if(i===1&&_o(e,"dtype")){if(r.dtype=e.dtype,js.indexOf(r.dtype)<0)return new TypeError(Ts('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",js.join('", "'),r.dtype))}else if(_o(e,"dtype")&&(r.dtype=e.dtype,Ms.indexOf(r.dtype)<0))return new TypeError(Ts('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Ms.join('", "'),r.dtype));return null}lN.exports=rne});var ac=s(function(gXe,ON){"use strict";var mN=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,hN=require("@stdlib/utils/define-nonenumerable-read-only-property"),To=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),tne=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),pN=Z(),yN=require("@stdlib/array/typed-real-ctors"),qN=require("@stdlib/array/base/filled-by"),bN=require("@stdlib/strided/base/nullary"),wN=require("@stdlib/string/format"),SN=dN(),nc=cN();function ine(){var r,e,i,t,n,a;if(i={idtype:SN.idtype,ndtype:SN.ndtype},e=arguments.length,t=u,e===0)n=pN;else if(e===1&&(r=arguments[0],n=pN.factory(r),a=nc(i,r,0),a))throw a;return To(t,"seed",g),To(t,"seedLength",f),tne(t,"state",h,y),To(t,"stateLength",m),To(t,"byteLength",c),hN(t,"PRNG",n),hN(t,"normalized",o),t;function u(d,l){var v,p,q,b,w;if(!mN(d))throw new TypeError(wN("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=nc(w,l,1),q))throw q;return b=w.dtype||i.idtype,b==="generic"?qN(d,n):(v=yN(b),p=new v(d),bN([p],[d],[1],n),p)}function o(d,l){var v,p,q,b,w;if(!mN(d))throw new TypeError(wN("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=nc(w,l,2),q))throw q;return b=w.dtype||i.ndtype,b==="generic"?qN(d,n.normalized):(v=yN(b),p=new v(d),bN([p],[d],[1],n.normalized),p)}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}ON.exports=ine});var EN=s(function(vXe,NN){"use strict";var nne=ac(),ane=nne();NN.exports=ane});var PN=s(function(fXe,RN){"use strict";var sne=require("@stdlib/utils/define-nonenumerable-read-only-property"),LN=EN(),une=ac();sne(LN,"factory",une);RN.exports=LN});var TN=s(function(dXe,_N){"use strict";var one=require("@stdlib/math/base/assert/is-nan"),gne=8;function vne(r,e,i){var t,n;for(n=0;n=0;n--)e[n]=r();return e}_N.exports=vne});var sc=s(function(lXe,jN){"use strict";var fne=require("@stdlib/constants/int32/max"),dne=require("@stdlib/math/base/special/floor"),lne=fne-1;function cne(){var r=dne(1+lne*Math.random());return r|0}jN.exports=cne});var gc=s(function(cXe,FN){"use strict";var Ur=require("@stdlib/utils/define-nonenumerable-read-only-property"),pt=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),MN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),uc=require("@stdlib/assert/has-own-property"),mne=require("@stdlib/assert/is-plain-object"),hne=require("@stdlib/assert/is-boolean").isPrimitive,pne=require("@stdlib/assert/is-collection"),yne=require("@stdlib/assert/is-positive-integer").isPrimitive,xN=require("@stdlib/assert/is-int32array"),fa=require("@stdlib/blas/base/gcopy"),qne=require("@stdlib/math/base/special/floor"),B=require("@stdlib/array/int32"),xs=require("@stdlib/constants/int32/max"),bne=require("@stdlib/array/to-json"),Q=require("@stdlib/string/format"),GN=TN(),AN=sc(),oc=xs-1|0,wne=xs-1|0,Sne=16807,D=32,xo=1,Go=3,yt=2,da=D+3,X=D+6,Gs=D+7,jo=da+1,Mo=da+2;function VN(r,e){var i;return e?i="option":i="argument",r.lengthwne)throw new RangeError(Q("invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.","seed",n));n|=0}else if(pne(n)&&n.length>0)a=n.length,e=new B(Gs+a),e[0]=xo,e[1]=Go,e[yt]=D,e[da]=2,e[Mo]=n[0],e[X]=a,fa.ndarray(a,n,1,0,e,1,X+1),i=new B(e.buffer,e.byteOffset+(yt+1)*e.BYTES_PER_ELEMENT,D),n=new B(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,a),i=GN(d,i,D),e[jo]=i[0];else throw new TypeError(Q("invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.","seed",n));else n=AN()|0}else n=AN()|0;return i===void 0&&(e=new B(Gs+1),e[0]=xo,e[1]=Go,e[yt]=D,e[da]=2,e[Mo]=n,e[X]=1,e[X+1]=n,i=new B(e.buffer,e.byteOffset+(yt+1)*e.BYTES_PER_ELEMENT,D),n=new B(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,1),i=GN(d,i,D),e[jo]=i[0]),Ur(l,"NAME","minstd-shuffle"),pt(l,"seed",o),pt(l,"seedLength",g),MN(l,"state",c,h),pt(l,"stateLength",f),pt(l,"byteLength",m),Ur(l,"toJSON",y),Ur(l,"MIN",1),Ur(l,"MAX",xs-1),Ur(l,"normalized",v),Ur(v,"NAME",l.NAME),pt(v,"seed",o),pt(v,"seedLength",g),MN(v,"state",c,h),pt(v,"stateLength",f),pt(v,"byteLength",m),Ur(v,"toJSON",y),Ur(v,"MIN",(l.MIN-1)/oc),Ur(v,"MAX",(l.MAX-1)/oc),l;function o(){var p=e[X];return fa(p,n,1,new B(p),1)}function g(){return e[X]}function f(){return e.length}function m(){return e.byteLength}function c(){var p=e.length;return fa(p,e,1,new B(p),1)}function h(p){var q;if(!xN(p))throw new TypeError(Q("invalid argument. Must provide an Int32Array. Value: `%s`.",p));if(q=VN(p,!1),q)throw q;t.copy===!1?t.state&&p.length===e.length?fa(p.length,p,1,e,1):(e=p,t.state=!0):(p.length!==e.length&&(e=new B(p.length)),fa(p.length,p,1,e,1)),i=new B(e.buffer,e.byteOffset+(yt+1)*e.BYTES_PER_ELEMENT,D),n=new B(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,e[X])}function y(){var p={};return p.type="PRNG",p.name=l.NAME,p.state=bne(e),p.params=[],p}function d(){var p=e[Mo]|0;return p=Sne*p%xs|0,e[Mo]=p,p|0}function l(){var p,q;return p=e[jo],q=qne(D*(p/xs)),p=i[q],e[jo]=p,i[q]=d(),p}function v(){return(l()-1)/oc}}FN.exports=One});var IN=s(function(mXe,WN){"use strict";var Nne=gc(),Ene=sc(),Lne=Nne({seed:Ene()});WN.exports=Lne});var $=s(function(hXe,kN){"use strict";var Rne=require("@stdlib/utils/define-nonenumerable-read-only-property"),zN=IN(),Pne=gc();Rne(zN,"factory",Pne);kN.exports=zN});var JN=s(function(pXe,_ne){_ne.exports={idtype:"float64",ndtype:"float64"}});var CN=s(function(yXe,UN){"use strict";var Tne=require("@stdlib/array/typed-real-float-dtypes"),jne=require("@stdlib/array/typed-real-dtypes"),Mne=require("@stdlib/assert/is-plain-object"),Ao=require("@stdlib/assert/has-own-property"),As=require("@stdlib/string/format"),Vs=jne(),Fs=Tne();Vs.push("generic");Fs.push("generic");function xne(r,e,i){if(!Mne(e))return new TypeError(As("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i===0){if(Ao(e,"idtype")&&(r.idtype=e.idtype,Vs.indexOf(r.idtype)<0))return new TypeError(As('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",Vs.join('", "'),r.idtype));if(Ao(e,"ndtype")&&(r.ndtype=e.ndtype,Fs.indexOf(r.ndtype)<0))return new TypeError(As('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",Fs.join('", "'),r.ndtype))}else if(i===1&&Ao(e,"dtype")){if(r.dtype=e.dtype,Vs.indexOf(r.dtype)<0)return new TypeError(As('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Vs.join('", "'),r.dtype))}else if(Ao(e,"dtype")&&(r.dtype=e.dtype,Fs.indexOf(r.dtype)<0))return new TypeError(As('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Fs.join('", "'),r.dtype));return null}UN.exports=xne});var fc=s(function(qXe,KN){"use strict";var BN=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,XN=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Gne=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),DN=$(),YN=require("@stdlib/array/typed-real-ctors"),HN=require("@stdlib/array/base/filled-by"),ZN=require("@stdlib/strided/base/nullary"),QN=require("@stdlib/string/format"),$N=JN(),vc=CN();function Ane(){var r,e,i,t,n,a;if(i={idtype:$N.idtype,ndtype:$N.ndtype},e=arguments.length,t=u,e===0)n=DN;else if(e===1&&(r=arguments[0],n=DN.factory(r),a=vc(i,r,0),a))throw a;return Vo(t,"seed",g),Vo(t,"seedLength",f),Gne(t,"state",h,y),Vo(t,"stateLength",m),Vo(t,"byteLength",c),XN(t,"PRNG",n),XN(t,"normalized",o),t;function u(d,l){var v,p,q,b,w;if(!BN(d))throw new TypeError(QN("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=vc(w,l,1),q))throw q;return b=w.dtype||i.idtype,b==="generic"?HN(d,n):(v=YN(b),p=new v(d),ZN([p],[d],[1],n),p)}function o(d,l){var v,p,q,b,w;if(!BN(d))throw new TypeError(QN("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=vc(w,l,2),q))throw q;return b=w.dtype||i.ndtype,b==="generic"?HN(d,n.normalized):(v=YN(b),p=new v(d),ZN([p],[d],[1],n.normalized),p)}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}KN.exports=Ane});var rE=s(function(bXe,eE){"use strict";var Vne=fc(),Fne=Vne();eE.exports=Fne});var nE=s(function(wXe,iE){"use strict";var Wne=require("@stdlib/utils/define-nonenumerable-read-only-property"),tE=rE(),Ine=fc();Wne(tE,"factory",Ine);iE.exports=tE});var aE=s(function(SXe,zne){zne.exports={idtype:"float64",ndtype:"float64"}});var uE=s(function(OXe,sE){"use strict";var kne=require("@stdlib/array/typed-real-float-dtypes"),Jne=require("@stdlib/array/typed-real-dtypes"),Une=require("@stdlib/assert/is-plain-object"),Fo=require("@stdlib/assert/has-own-property"),Ws=require("@stdlib/string/format"),Is=Jne(),zs=kne();Is.push("generic");zs.push("generic");function Cne(r,e,i){if(!Une(e))return new TypeError(Ws("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i===0){if(Fo(e,"idtype")&&(r.idtype=e.idtype,Is.indexOf(r.idtype)<0))return new TypeError(Ws('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",Is.join('", "'),r.idtype));if(Fo(e,"ndtype")&&(r.ndtype=e.ndtype,zs.indexOf(r.ndtype)<0))return new TypeError(Ws('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",zs.join('", "'),r.ndtype))}else if(i===1&&Fo(e,"dtype")){if(r.dtype=e.dtype,Is.indexOf(r.dtype)<0)return new TypeError(Ws('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Is.join('", "'),r.dtype))}else if(Fo(e,"dtype")&&(r.dtype=e.dtype,zs.indexOf(r.dtype)<0))return new TypeError(Ws('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",zs.join('", "'),r.dtype));return null}sE.exports=Cne});var lc=s(function(NXe,hE){"use strict";var oE=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,gE=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Bne=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),vE=j(),fE=require("@stdlib/array/typed-real-ctors"),dE=require("@stdlib/array/base/filled-by"),lE=require("@stdlib/strided/base/nullary"),cE=require("@stdlib/string/format"),mE=aE(),dc=uE();function Xne(){var r,e,i,t,n,a;if(i={idtype:mE.idtype,ndtype:mE.ndtype},e=arguments.length,t=u,e===0)n=vE;else if(e===1&&(r=arguments[0],n=vE.factory(r),a=dc(i,r,0),a))throw a;return Wo(t,"seed",g),Wo(t,"seedLength",f),Bne(t,"state",h,y),Wo(t,"stateLength",m),Wo(t,"byteLength",c),gE(t,"PRNG",n),gE(t,"normalized",o),t;function u(d,l){var v,p,q,b,w;if(!oE(d))throw new TypeError(cE("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=dc(w,l,1),q))throw q;return b=w.dtype||i.idtype,b==="generic"?dE(d,n):(v=fE(b),p=new v(d),lE([p],[d],[1],n),p)}function o(d,l){var v,p,q,b,w;if(!oE(d))throw new TypeError(cE("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=dc(w,l,2),q))throw q;return b=w.dtype||i.ndtype,b==="generic"?dE(d,n.normalized):(v=fE(b),p=new v(d),lE([p],[d],[1],n.normalized),p)}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}hE.exports=Xne});var yE=s(function(EXe,pE){"use strict";var Dne=lc(),Yne=Dne();pE.exports=Yne});var wE=s(function(LXe,bE){"use strict";var Hne=require("@stdlib/utils/define-nonenumerable-read-only-property"),qE=yE(),Zne=lc();Hne(qE,"factory",Zne);bE.exports=qE});var NE=s(function(RXe,OE){"use strict";var Qne=require("@stdlib/assert/is-number").isPrimitive,$ne=require("@stdlib/assert/is-positive-number").isPrimitive,SE=require("@stdlib/string/format"),Kne=require("@stdlib/assert/is-nan");function eae(r,e){return!Qne(r)||Kne(r)?new TypeError(SE("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):$ne(e)?null:new TypeError(SE("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}OE.exports=eae});var LE=s(function(PXe,EE){"use strict";function rae(r,e,i){return e+i*r()}EE.exports=rae});var cc=s(function(_Xe,GE){"use strict";var qt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Io=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),PE=require("@stdlib/assert/is-plain-object"),_E=require("@stdlib/assert/is-function"),TE=require("@stdlib/assert/has-own-property"),jE=require("@stdlib/utils/constant-function"),tae=require("@stdlib/utils/noop"),la=H().factory,ME=require("@stdlib/math/base/assert/is-nan"),iae=require("@stdlib/array/to-json"),zo=require("@stdlib/string/format"),nae=NE(),xE=LE();function aae(){var r,e,i,t,n,a,u;if(arguments.length===0)e=la();else if(arguments.length===1){if(i=arguments[0],!PE(i))throw new TypeError(zo("invalid argument. Options argument must be an object. Value: `%s`.",i));if(TE(i,"prng")){if(!_E(i.prng))throw new TypeError(zo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=la({prng:i.prng})}else e=la(i)}else{if(u=arguments[0],r=arguments[1],a=nae(u,r),a)throw a;if(arguments.length>2){if(i=arguments[2],!PE(i))throw new TypeError(zo("invalid argument. Options argument must be an object. Value: `%s`.",i));if(TE(i,"prng")){if(!_E(i.prng))throw new TypeError(zo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=la({prng:i.prng})}else e=la(i)}else e=la()}return u===void 0?n=l:n=d,t=e.PRNG,qt(n,"NAME","normal"),i&&i.prng?(qt(n,"seed",null),qt(n,"seedLength",null),RE(n,"state",jE(null),tae),qt(n,"stateLength",null),qt(n,"byteLength",null),qt(n,"toJSON",jE(null))):(Io(n,"seed",o),Io(n,"seedLength",g),RE(n,"state",c,h),Io(n,"stateLength",f),Io(n,"byteLength",m),qt(n,"toJSON",y)),qt(n,"PRNG",t),n;function o(){return t.seed}function g(){return t.seedLength}function f(){return t.stateLength}function m(){return t.byteLength}function c(){return t.state}function h(v){t.state=v}function y(){var v={};return v.type="PRNG",v.name=n.NAME,v.state=iae(t.state),u===void 0?v.params=[]:v.params=[u,r],v}function d(){return xE(e,u,r)}function l(v,p){return ME(v)||ME(p)||p<=0?NaN:xE(e,v,p)}}GE.exports=aae});var VE=s(function(TXe,AE){"use strict";var sae=cc(),uae=sae();AE.exports=uae});var vn=s(function(jXe,WE){"use strict";var oae=require("@stdlib/utils/define-nonenumerable-read-only-property"),FE=VE(),gae=cc();oae(FE,"factory",gae);WE.exports=FE});var IE=s(function(MXe,vae){vae.exports={dtype:"float64"}});var JE=s(function(xXe,kE){"use strict";var fae=require("@stdlib/array/typed-real-float-dtypes"),dae=require("@stdlib/assert/is-plain-object"),lae=require("@stdlib/assert/has-own-property"),zE=require("@stdlib/string/format"),mc=fae();mc.push("generic");function cae(r,e){return dae(e)?lae(e,"dtype")&&(r.dtype=e.dtype,mc.indexOf(r.dtype)<0)?new TypeError(zE('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",mc.join('", "'),r.dtype)):null:new TypeError(zE("invalid argument. Options argument must be an object. Value: `%s`.",e))}kE.exports=cae});var hc=s(function(GXe,YE){"use strict";var UE=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ks=require("@stdlib/utils/define-nonenumerable-read-only-property"),ko=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),CE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),mae=require("@stdlib/utils/constant-function"),hae=require("@stdlib/utils/noop"),Jo=vn(),BE=require("@stdlib/array/typed-real-float-ctors"),XE=require("@stdlib/array/base/filled-by"),pae=require("@stdlib/strided/base/nullary"),yae=require("@stdlib/strided/base/binary"),DE=require("@stdlib/string/format"),qae=IE(),Uo=JE();function bae(){var r,e,i,t,n,a;if(i={dtype:qae.dtype},e=arguments.length,e===0)n=Jo,t=o;else if(e===1){if(r=arguments[0],n=Jo.factory(r),a=Uo(i,r),a)throw a;t=o}else if(e===2)n=Jo.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=Jo.factory(arguments[0],arguments[1],r),a=Uo(i,r),a)throw a;t=u}return r&&r.prng?(ks(t,"seed",null),ks(t,"seedLength",null),CE(t,"state",mae(null),hae),ks(t,"stateLength",null),ks(t,"byteLength",null)):(ko(t,"seed",g),ko(t,"seedLength",f),CE(t,"state",h,y),ko(t,"stateLength",m),ko(t,"byteLength",c)),ks(t,"PRNG",n.PRNG),t;function u(d,l){var v,p,q,b,w;if(!UE(d))throw new TypeError(DE("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=Uo(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?XE(d,n):(v=BE(b),p=new v(d),pae([p],[d],[1],n),p)}function o(d,l,v,p){var q,b,w,S,O;if(!UE(d))throw new TypeError(DE("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(O={},arguments.length>3&&(w=Uo(O,p),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return XE(d,M);return q=BE(S),b=new q(d),yae([[l],[v],b],[d],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}YE.exports=bae});var ZE=s(function(AXe,HE){"use strict";var wae=hc(),Sae=wae();HE.exports=Sae});var KE=s(function(VXe,$E){"use strict";var Oae=require("@stdlib/utils/define-nonenumerable-read-only-property"),QE=ZE(),Nae=hc();Oae(QE,"factory",Nae);$E.exports=QE});var eL=s(function(FXe,Eae){Eae.exports={name:"mt19937",copy:!0}});var tL=s(function(WXe,rL){"use strict";var Lae=Z(),Rae=$(),Pae=j(),Co={};Co.minstd=Lae;Co["minstd-shuffle"]=Rae;Co.mt19937=Pae;rL.exports=Co});var pc=s(function(IXe,nL){"use strict";var Js=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_ae=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Tae=require("@stdlib/assert/is-plain-object"),jae=require("@stdlib/assert/is-boolean").isPrimitive,Xo=require("@stdlib/assert/has-own-property"),Mae=require("@stdlib/array/to-json"),Us=require("@stdlib/string/format"),iL=eL(),xae=tL();function Gae(r){var e,i,t;if(e={name:iL.name,copy:iL.copy},arguments.length){if(!Tae(r))throw new TypeError(Us("invalid argument. Must provide an object. Value: `%s`.",r));if(Xo(r,"name")&&(e.name=r.name),Xo(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(Us("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(Xo(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(Us("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(Xo(r,"copy")&&(e.copy=r.copy,!jae(e.copy)))throw new TypeError(Us("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(t=xae[e.name],t===void 0)throw new Error(Us("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.state===void 0?e.seed===void 0?i=t.factory():i=t.factory({seed:e.seed}):i=t.factory({state:e.state,copy:e.copy}),Js(c,"NAME","randu"),Bo(c,"seed",n),Bo(c,"seedLength",a),_ae(c,"state",g,f),Bo(c,"stateLength",u),Bo(c,"byteLength",o),Js(c,"toJSON",m),Js(c,"PRNG",i),Js(c,"MIN",i.normalized.MIN),Js(c,"MAX",i.normalized.MAX),c;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function f(h){i.state=h}function m(){var h={};return h.type="PRNG",h.name=c.NAME+"-"+i.NAME,h.state=Mae(i.state),h.params=[],h}function c(){return i.normalized()}}nL.exports=Gae});var sL=s(function(zXe,aL){"use strict";var Aae=pc(),Vae=Aae();aL.exports=Vae});var bt=s(function(kXe,oL){"use strict";var Fae=require("@stdlib/utils/define-nonenumerable-read-only-property"),uL=sL(),Wae=pc();Fae(uL,"factory",Wae);oL.exports=uL});var gL=s(function(JXe,Iae){Iae.exports={dtype:"float64"}});var dL=s(function(UXe,fL){"use strict";var zae=require("@stdlib/array/typed-real-float-dtypes"),kae=require("@stdlib/assert/is-plain-object"),Jae=require("@stdlib/assert/has-own-property"),vL=require("@stdlib/string/format"),yc=zae();yc.push("generic");function Uae(r,e){return kae(e)?Jae(e,"dtype")&&(r.dtype=e.dtype,yc.indexOf(r.dtype)<0)?new TypeError(vL('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",yc.join('", "'),r.dtype)):null:new TypeError(vL("invalid argument. Options argument must be an object. Value: `%s`.",e))}fL.exports=Uae});var qc=s(function(CXe,mL){"use strict";var Cae=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Bae=require("@stdlib/utils/define-nonenumerable-read-only-property"),Do=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Xae=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lL=bt(),Dae=require("@stdlib/array/typed-real-float-ctors"),Yae=require("@stdlib/array/base/filled-by"),Hae=require("@stdlib/strided/base/nullary"),Zae=require("@stdlib/string/format"),Qae=gL(),cL=dL();function $ae(){var r,e,i,t,n,a;if(i={dtype:Qae.dtype},e=arguments.length,t=u,e===0)n=lL;else if(e===1&&(r=arguments[0],n=lL.factory(r),a=cL(i,r),a))throw a;return Do(t,"seed",o),Do(t,"seedLength",g),Xae(t,"state",c,h),Do(t,"stateLength",f),Do(t,"byteLength",m),Bae(t,"PRNG",n.PRNG),t;function u(y,d){var l,v,p,q,b;if(!Cae(y))throw new TypeError(Zae("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",y));if(b={},arguments.length>1&&(p=cL(b,d),p))throw p;return q=b.dtype||i.dtype,q==="generic"?Yae(y,n):(l=Dae(q),v=new l(y),Hae([v],[y],[1],n),v)}function o(){return t.PRNG.seed}function g(){return t.PRNG.seedLength}function f(){return t.PRNG.stateLength}function m(){return t.PRNG.byteLength}function c(){return t.PRNG.state}function h(y){t.PRNG.state=y}}mL.exports=$ae});var pL=s(function(BXe,hL){"use strict";var Kae=qc(),ese=Kae();hL.exports=ese});var bL=s(function(XXe,qL){"use strict";var rse=require("@stdlib/utils/define-nonenumerable-read-only-property"),yL=pL(),tse=qc();rse(yL,"factory",tse);qL.exports=yL});var NL=s(function(DXe,OL){"use strict";var wL=require("@stdlib/assert/is-number").isPrimitive,bc=require("@stdlib/string/format"),SL=require("@stdlib/assert/is-nan");function ise(r,e){return!wL(r)||SL(r)?new TypeError(bc("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!wL(e)||SL(e)?new TypeError(bc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(bc("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}OL.exports=ise});var LL=s(function(YXe,EL){"use strict";function nse(r,e,i){var t=r();return i*t+(1-t)*e}EL.exports=nse});var wc=s(function(HXe,GL){"use strict";var Cr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),PL=require("@stdlib/assert/is-plain-object"),_L=require("@stdlib/assert/is-function"),TL=require("@stdlib/assert/has-own-property"),jL=require("@stdlib/utils/constant-function"),ase=require("@stdlib/utils/noop"),Ho=j().factory,ML=require("@stdlib/math/base/assert/is-nan"),sse=require("@stdlib/array/to-json"),Zo=require("@stdlib/string/format"),use=NL(),xL=LL();function ose(){var r,e,i,t,n,a;if(arguments.length===0)e=Ho();else if(arguments.length===1){if(r=arguments[0],!PL(r))throw new TypeError(Zo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(TL(r,"prng")){if(!_L(r.prng))throw new TypeError(Zo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Ho(r)}else{if(n=arguments[0],a=arguments[1],t=use(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!PL(r))throw new TypeError(Zo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(TL(r,"prng")){if(!_L(r.prng))throw new TypeError(Zo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Ho(r)}else e=Ho()}return n===void 0?i=d:i=y,Cr(i,"NAME","uniform"),r&&r.prng?(Cr(i,"seed",null),Cr(i,"seedLength",null),RL(i,"state",jL(null),ase),Cr(i,"stateLength",null),Cr(i,"byteLength",null),Cr(i,"toJSON",jL(null)),Cr(i,"PRNG",e)):(Yo(i,"seed",u),Yo(i,"seedLength",o),RL(i,"state",m,c),Yo(i,"stateLength",g),Yo(i,"byteLength",f),Cr(i,"toJSON",h),Cr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function f(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function h(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=sse(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return xL(e,n,a)}function d(l,v){return ML(l)||ML(v)||l>=v?NaN:xL(e,l,v)}}GL.exports=ose});var VL=s(function(ZXe,AL){"use strict";var gse=wc(),vse=gse();AL.exports=vse});var fn=s(function(QXe,WL){"use strict";var fse=require("@stdlib/utils/define-nonenumerable-read-only-property"),FL=VL(),dse=wc();fse(FL,"factory",dse);WL.exports=FL});var IL=s(function($Xe,lse){lse.exports={dtype:"float64"}});var JL=s(function(KXe,kL){"use strict";var cse=require("@stdlib/array/typed-real-float-dtypes"),mse=require("@stdlib/assert/is-plain-object"),hse=require("@stdlib/assert/has-own-property"),zL=require("@stdlib/string/format"),Sc=cse();Sc.push("generic");function pse(r,e){return mse(e)?hse(e,"dtype")&&(r.dtype=e.dtype,Sc.indexOf(r.dtype)<0)?new TypeError(zL('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Sc.join('", "'),r.dtype)):null:new TypeError(zL("invalid argument. Options argument must be an object. Value: `%s`.",e))}kL.exports=pse});var Oc=s(function(e7e,YL){"use strict";var UL=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Cs=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),CL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),yse=require("@stdlib/utils/constant-function"),qse=require("@stdlib/utils/noop"),$o=fn(),BL=require("@stdlib/array/typed-real-float-ctors"),XL=require("@stdlib/array/base/filled-by"),bse=require("@stdlib/strided/base/nullary"),wse=require("@stdlib/strided/base/binary"),DL=require("@stdlib/string/format"),Sse=IL(),Ko=JL();function Ose(){var r,e,i,t,n,a;if(i={dtype:Sse.dtype},e=arguments.length,e===0)n=$o,t=o;else if(e===1){if(r=arguments[0],n=$o.factory(r),a=Ko(i,r),a)throw a;t=o}else if(e===2)n=$o.factory(arguments[0],arguments[1]),t=u;else if(e===3){if(r=arguments[2],n=$o.factory(arguments[0],arguments[1],r),a=Ko(i,r),a)throw a;t=u}return r&&r.prng?(Cs(t,"seed",null),Cs(t,"seedLength",null),CL(t,"state",yse(null),qse),Cs(t,"stateLength",null),Cs(t,"byteLength",null)):(Qo(t,"seed",g),Qo(t,"seedLength",f),CL(t,"state",h,y),Qo(t,"stateLength",m),Qo(t,"byteLength",c)),Cs(t,"PRNG",n.PRNG),t;function u(d,l){var v,p,q,b,w;if(!UL(d))throw new TypeError(DL("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(w={},arguments.length>1&&(q=Ko(w,l),q))throw q;return b=w.dtype||i.dtype,b==="generic"?XL(d,n):(v=BL(b),p=new v(d),bse([p],[d],[1],n),p)}function o(d,l,v,p){var q,b,w,S,O;if(!UL(d))throw new TypeError(DL("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",d));if(O={},arguments.length>3&&(w=Ko(O,p),w))throw w;if(S=O.dtype||i.dtype,S==="generic")return XL(d,M);return q=BL(S),b=new q(d),wse([[l],[v],b],[d],[0,0,1],n),b;function M(){return n(l,v)}}function g(){return t.PRNG.seed}function f(){return t.PRNG.seedLength}function m(){return t.PRNG.stateLength}function c(){return t.PRNG.byteLength}function h(){return t.PRNG.state}function y(d){t.PRNG.state=d}}YL.exports=Ose});var ZL=s(function(r7e,HL){"use strict";var Nse=Oc(),Ese=Nse();HL.exports=Ese});var KL=s(function(t7e,$L){"use strict";var Lse=require("@stdlib/utils/define-nonenumerable-read-only-property"),QL=ZL(),Rse=Oc();Lse(QL,"factory",Rse);$L.exports=QL});var rR=s(function(i7e,eR){"use strict";var F=require("@stdlib/utils/define-read-only-property"),A={};F(A,"arcsine",$p());F(A,"beta",lq());F(A,"betaprime",db());F(A,"cosine",Cb());F(A,"discreteUniform",Nw());F(A,"exponential",dS());F(A,"gamma",RS());F(A,"geometric",DS());F(A,"invgamma",OO());F(A,"lognormal",rN());F(A,"minstd",PN());F(A,"minstdShuffle",nE());F(A,"mt19937",wE());F(A,"normal",KE());F(A,"randu",bL());F(A,"uniform",KL());eR.exports=A});var Nc=s(function(n7e,uR){"use strict";var Br=require("@stdlib/utils/define-nonenumerable-read-only-property"),eg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),tR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),iR=require("@stdlib/assert/is-plain-object"),Pse=require("@stdlib/assert/is-probability").isPrimitive,nR=require("@stdlib/assert/is-function"),aR=require("@stdlib/assert/has-own-property"),sR=require("@stdlib/utils/constant-function"),_se=require("@stdlib/utils/noop"),rg=j().factory,Tse=require("@stdlib/math/base/assert/is-nan"),jse=require("@stdlib/array/to-json"),tg=require("@stdlib/string/format");function Mse(){var r,e,i,t;if(arguments.length===0)e=rg();else if(arguments.length===1&&iR(arguments[0]))if(r=arguments[0],aR(r,"prng")){if(!nR(r.prng))throw new TypeError(tg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=rg(r);else{if(t=arguments[0],!Pse(t))throw new TypeError(tg("invalid argument. First argument must be a probability. Value: `%s`.",t));if(arguments.length>1){if(r=arguments[1],!iR(r))throw new TypeError(tg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(aR(r,"prng")){if(!nR(r.prng))throw new TypeError(tg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=rg(r)}else e=rg()}return t===void 0?i=h:i=c,Br(i,"NAME","bernoulli"),r&&r.prng?(Br(i,"seed",null),Br(i,"seedLength",null),tR(i,"state",sR(null),_se),Br(i,"stateLength",null),Br(i,"byteLength",null),Br(i,"toJSON",sR(null)),Br(i,"PRNG",e)):(eg(i,"seed",n),eg(i,"seedLength",a),tR(i,"state",g,f),eg(i,"stateLength",u),eg(i,"byteLength",o),Br(i,"toJSON",m),Br(i,"PRNG",e),e=e.normalized),i;function n(){return e.seed}function a(){return e.seedLength}function u(){return e.stateLength}function o(){return e.byteLength}function g(){return e.state}function f(y){e.state=y}function m(){var y={};return y.type="PRNG",y.name=i.NAME,y.state=jse(e.state),t===void 0?y.params=[]:y.params=[t],y}function c(){return e()<=t?1:0}function h(y){return Tse(y)||y<0||y>1?NaN:e()<=y?1:0}}uR.exports=Mse});var gR=s(function(a7e,oR){"use strict";var xse=Nc(),Gse=xse();oR.exports=Gse});var Bs=s(function(s7e,fR){"use strict";var Ase=require("@stdlib/utils/define-nonenumerable-read-only-property"),vR=gR(),Vse=Nc();Ase(vR,"factory",Vse);fR.exports=vR});var cR=s(function(u7e,lR){"use strict";var Fse=require("@stdlib/assert/is-positive-integer").isPrimitive,Wse=require("@stdlib/assert/is-probability").isPrimitive,dR=require("@stdlib/string/format");function Ise(r,e){return Fse(r)?Wse(e)?null:new TypeError(dR("invalid argument. Second argument must be a probability. Value: `%s`.",e)):new TypeError(dR("invalid argument. First argument must be a positive integer. Value: `%s`.",e))}lR.exports=Ise});var hR=s(function(o7e,mR){"use strict";function zse(r,e,i){var t=0,n;for(n=0;n=d?Y=r()-.5:(Y=I/d-.93,Y=Xse(Y)*.5-Y,I=d*r()),c=.5-Lc(Y),S=Ec(Y*(2*l/c+v)+p),!(S<0||S>e))if(I=I*t/(l/(c*c)+v),h=Lc(S-O),h>15){if(I=ig(I),o=h/u,g=(h/3+.625)*h,g+=Yse,g/=u,o*=g+.5,Ce=-(h*h)/(2*u),IS)for(w=S;w<=O;w++)I*=m/w-x;if(I<=q)return S}}}qR.exports=Hse});var OR=s(function(f7e,SR){"use strict";var Zse=hR(),Qse=bR();function wR(r,e,i){return i>.5?e-wR(r,e,1-i):e*i<10?Zse(r,e,i):Qse(r,e,i)}SR.exports=wR});var Rc=s(function(d7e,jR){"use strict";var Xr=require("@stdlib/utils/define-nonenumerable-read-only-property"),ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ER=require("@stdlib/assert/is-plain-object"),LR=require("@stdlib/assert/is-function"),RR=require("@stdlib/assert/has-own-property"),PR=require("@stdlib/utils/constant-function"),$se=require("@stdlib/utils/noop"),_R=require("@stdlib/math/base/assert/is-nan"),Kse=require("@stdlib/math/base/assert/is-positive-integer"),eue=require("@stdlib/math/base/assert/is-probability"),sg=j().factory,rue=require("@stdlib/array/to-json"),ug=require("@stdlib/string/format"),tue=cR(),TR=OR();function iue(){var r,e,i,t,n,a;if(arguments.length===0)e=sg();else if(arguments.length===1){if(r=arguments[0],!ER(r))throw new TypeError(ug("invalid argument. Options argument must be an object. Value: `%s`.",r));if(RR(r,"prng")){if(!LR(r.prng))throw new TypeError(ug("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=sg(r)}else{if(n=arguments[0],a=arguments[1],t=tue(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!ER(r))throw new TypeError(ug("invalid argument. Options argument must be an object. Value: `%s`.",r));if(RR(r,"prng")){if(!LR(r.prng))throw new TypeError(ug("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=sg(r)}else e=sg()}return n===void 0?i=d:i=y,Xr(i,"NAME","binomial"),r&&r.prng?(Xr(i,"seed",null),Xr(i,"seedLength",null),NR(i,"state",PR(null),$se),Xr(i,"stateLength",null),Xr(i,"byteLength",null),Xr(i,"toJSON",PR(null)),Xr(i,"PRNG",e)):(ag(i,"seed",u),ag(i,"seedLength",o),NR(i,"state",m,c),ag(i,"stateLength",g),ag(i,"byteLength",f),Xr(i,"toJSON",h),Xr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function f(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function h(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=rue(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return TR(e,n,a)}function d(l,v){return _R(l)||_R(v)||!Kse(l)||!eue(v)?NaN:TR(e,l,v)}}jR.exports=iue});var xR=s(function(l7e,MR){"use strict";var nue=Rc(),aue=nue();MR.exports=aue});var Xs=s(function(c7e,AR){"use strict";var sue=require("@stdlib/utils/define-nonenumerable-read-only-property"),GR=xR(),uue=Rc();sue(GR,"factory",uue);AR.exports=GR});var FR=s(function(m7e,VR){"use strict";var oue=require("@stdlib/math/base/special/sqrt"),gue=require("@stdlib/math/base/special/ln"),vue=require("@stdlib/math/base/special/sin"),fue=require("@stdlib/math/base/special/cos"),due=require("@stdlib/constants/float64/two-pi");function lue(r){var e,i;return e=!0,t;function t(){var n,a,u,o;if(e){do n=r(),a=r();while(n===0);return u=oue(-2*gue(n)),o=due*a,i=u*fue(o),e=!1,u*vue(o)}return e=!0,i}}VR.exports=lue});var IR=s(function(h7e,WR){"use strict";var cue=require("@stdlib/math/base/special/sqrt"),mue=require("@stdlib/math/base/special/ln"),hue=require("@stdlib/math/base/special/cos"),pue=require("@stdlib/constants/float64/pi"),yue=hue(pue);function que(r){var e=cue(-2*mue(r));return e*yue}WR.exports=que});var kR=s(function(p7e,zR){"use strict";var bue=require("@stdlib/math/base/special/sqrt"),wue=require("@stdlib/math/base/special/ln"),Sue=require("@stdlib/math/base/special/cos"),Oue=require("@stdlib/constants/float64/two-pi");function Nue(r){var e=bue(-2*wue(r)),i=Oue*r;return e*Sue(i)}zR.exports=Nue});var Pc=s(function(y7e,BR){"use strict";var K=require("@stdlib/utils/define-nonenumerable-read-only-property"),og=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),JR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Eue=require("@stdlib/assert/is-plain-object"),Lue=require("@stdlib/assert/is-function"),Rue=require("@stdlib/assert/is-boolean").isPrimitive,Ds=require("@stdlib/assert/has-own-property"),Pue=require("@stdlib/assert/is-uint32array"),UR=j().factory,CR=require("@stdlib/utils/constant-function"),_ue=require("@stdlib/utils/noop"),Tue=require("@stdlib/array/to-json"),Ys=require("@stdlib/string/format"),jue=FR(),Mue=IR(),xue=kR();function Gue(r){var e,i,t,n;if(n={copy:!0},arguments.length){if(!Eue(r))throw new TypeError(Ys("invalid argument. Must provide an object. Value: `%s`.",r));if(Ds(r,"copy")&&(n.copy=r.copy,!Rue(r.copy)))throw new TypeError(Ys("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(Ds(r,"prng")){if(!Lue(r.prng))throw new TypeError(Ys("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else if(Ds(r,"state")){if(n.state=r.state,!Pue(r.state))throw new TypeError(Ys("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",r.state))}else if(Ds(r,"seed")&&(n.seed=r.seed,r.seed===void 0))throw new TypeError(Ys("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.","seed",r.seed))}return n.state===void 0?e===void 0?(t=UR(n),e=t.normalized):n.seed=null:(t=UR(n),e=t.normalized),i=jue(e),K(i,"NAME","box-muller"),n.seed===null?(K(i,"seed",null),K(i,"seedLength",null)):(og(i,"seed",a),og(i,"seedLength",u)),r&&r.prng?(JR(i,"state",CR(null),_ue),K(i,"stateLength",null),K(i,"byteLength",null),K(i,"toJSON",CR(null))):(JR(i,"state",f,m),og(i,"stateLength",o),og(i,"byteLength",g),K(i,"toJSON",c)),K(i,"PRNG",e),Ds(e,"MIN")?(K(i,"MIN",Mue(e.MIN)),K(i,"MAX",xue(e.MIN))):(K(i,"MIN",null),K(i,"MAX",null)),i;function a(){return t.seed}function u(){return t.seedLength}function o(){return t.stateLength}function g(){return t.byteLength}function f(){return t.state}function m(h){t.state=h}function c(){var h={};return h.type="PRNG",h.name=i.NAME,h.state=Tue(t.state),h.params=[],h}}BR.exports=Gue});var DR=s(function(q7e,XR){"use strict";var Aue=Pc(),Vue=Aue();XR.exports=Vue});var ca=s(function(b7e,HR){"use strict";var Fue=require("@stdlib/utils/define-nonenumerable-read-only-property"),YR=DR(),Wue=Pc();Fue(YR,"factory",Wue);HR.exports=YR});var $R=s(function(w7e,QR){"use strict";var Iue=require("@stdlib/assert/is-number").isPrimitive,zue=require("@stdlib/assert/is-positive-number").isPrimitive,ZR=require("@stdlib/string/format"),kue=require("@stdlib/assert/is-nan");function Jue(r,e){return!Iue(r)||kue(r)?new TypeError(ZR("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):zue(e)?null:new TypeError(ZR("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}QR.exports=Jue});var eP=s(function(S7e,KR){"use strict";var Uue=require("@stdlib/math/base/special/tan"),Cue=require("@stdlib/constants/float64/pi");function Bue(r,e,i){return e+i*Uue(Cue*(r()-.5))}KR.exports=Bue});var _c=s(function(O7e,oP){"use strict";var wt=require("@stdlib/utils/define-nonenumerable-read-only-property"),gg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),rP=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),tP=require("@stdlib/assert/is-plain-object"),iP=require("@stdlib/assert/is-function"),nP=require("@stdlib/assert/has-own-property"),aP=require("@stdlib/utils/constant-function"),Xue=require("@stdlib/utils/noop"),sP=require("@stdlib/math/base/assert/is-nan"),ma=H().factory,Due=require("@stdlib/array/to-json"),vg=require("@stdlib/string/format"),Yue=$R(),uP=eP();function Hue(){var r,e,i,t,n,a,u;if(arguments.length===0)e=ma();else if(arguments.length===1){if(i=arguments[0],!tP(i))throw new TypeError(vg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(nP(i,"prng")){if(!iP(i.prng))throw new TypeError(vg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=ma({prng:i.prng})}else e=ma(i)}else{if(u=arguments[0],r=arguments[1],a=Yue(u,r),a)throw a;if(arguments.length>2){if(i=arguments[2],!tP(i))throw new TypeError(vg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(nP(i,"prng")){if(!iP(i.prng))throw new TypeError(vg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=ma({prng:i.prng})}else e=ma(i)}else e=ma()}return u===void 0?n=l:n=d,t=e.PRNG,wt(n,"NAME","cauchy"),i&&i.prng?(wt(n,"seed",null),wt(n,"seedLength",null),rP(n,"state",aP(null),Xue),wt(n,"stateLength",null),wt(n,"byteLength",null),wt(n,"toJSON",aP(null))):(gg(n,"seed",o),gg(n,"seedLength",g),rP(n,"state",c,h),gg(n,"stateLength",f),gg(n,"byteLength",m),wt(n,"toJSON",y)),wt(n,"PRNG",t),n;function o(){return t.seed}function g(){return t.seedLength}function f(){return t.stateLength}function m(){return t.byteLength}function c(){return t.state}function h(v){t.state=v}function y(){var v={};return v.type="PRNG",v.name=n.NAME,v.state=Due(t.state),u===void 0?v.params=[]:v.params=[u,r],v}function d(){return uP(e,u,r)}function l(v,p){return sP(v)||sP(p)||p<=0?NaN:uP(e,v,p)}}oP.exports=Hue});var vP=s(function(N7e,gP){"use strict";var Zue=_c(),Que=Zue();gP.exports=Que});var Hs=s(function(E7e,dP){"use strict";var $ue=require("@stdlib/utils/define-nonenumerable-read-only-property"),fP=vP(),Kue=_c();$ue(fP,"factory",Kue);dP.exports=fP});var Tc=s(function(L7e,yP){"use strict";var St=require("@stdlib/utils/define-nonenumerable-read-only-property"),fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),lP=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),eoe=require("@stdlib/assert/is-positive-number").isPrimitive,cP=require("@stdlib/assert/is-plain-object"),mP=require("@stdlib/assert/is-function"),hP=require("@stdlib/assert/has-own-property"),pP=require("@stdlib/utils/constant-function"),roe=require("@stdlib/utils/noop"),toe=require("@stdlib/math/base/assert/is-nan"),ha=ke().factory,ioe=require("@stdlib/array/to-json"),dg=require("@stdlib/string/format");function noe(){var r,e,i,t,n;if(arguments.length===0)r=ha();else if(arguments.length===1&&cP(arguments[0]))if(i=arguments[0],hP(i,"prng")){if(!mP(i.prng))throw new TypeError(dg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=ha({prng:i.prng})}else r=ha(i);else{if(n=arguments[0],!eoe(n))throw new TypeError(dg("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(i=arguments[1],!cP(i))throw new TypeError(dg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(hP(i,"prng")){if(!mP(i.prng))throw new TypeError(dg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=ha(n/2,.5,{prng:i.prng})}else r=ha(n/2,.5,i)}else r=ha(n/2,.5)}return n===void 0?t=y:t=h,e=r.PRNG,St(t,"NAME","chisquare"),i&&i.prng?(St(t,"seed",null),St(t,"seedLength",null),lP(t,"state",pP(null),roe),St(t,"stateLength",null),St(t,"byteLength",null),St(t,"toJSON",pP(null))):(fg(t,"seed",a),fg(t,"seedLength",u),lP(t,"state",f,m),fg(t,"stateLength",o),fg(t,"byteLength",g),St(t,"toJSON",c)),St(t,"PRNG",e),t;function a(){return e.seed}function u(){return e.seedLength}function o(){return e.stateLength}function g(){return e.byteLength}function f(){return e.state}function m(d){e.state=d}function c(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=ioe(e.state),n===void 0?d.params=[]:d.params=[n],d}function h(){return r()}function y(d){return toe(d)||d<=0?NaN:r(d/2,.5)}}yP.exports=noe});var bP=s(function(R7e,qP){"use strict";var aoe=Tc(),soe=aoe();qP.exports=soe});var Ot=s(function(P7e,SP){"use strict";var uoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),wP=bP(),ooe=Tc();uoe(wP,"factory",ooe);SP.exports=wP});var jc=s(function(_7e,_P){"use strict";var Nt=require("@stdlib/utils/define-nonenumerable-read-only-property"),lg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),OP=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),goe=require("@stdlib/assert/is-positive-number").isPrimitive,NP=require("@stdlib/assert/is-plain-object"),EP=require("@stdlib/assert/is-function"),LP=require("@stdlib/assert/has-own-property"),RP=require("@stdlib/utils/constant-function"),voe=require("@stdlib/utils/noop"),foe=require("@stdlib/math/base/assert/is-nan"),pa=Ot().factory,doe=require("@stdlib/array/to-json"),PP=require("@stdlib/math/base/special/sqrt"),cg=require("@stdlib/string/format");function loe(){var r,e,i,t,n;if(arguments.length===0)r=pa();else if(arguments.length===1&&NP(arguments[0]))if(i=arguments[0],LP(i,"prng")){if(!EP(i.prng))throw new TypeError(cg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=pa({prng:i.prng})}else r=pa(i);else{if(n=arguments[0],!goe(n))throw new TypeError(cg("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(i=arguments[1],!NP(i))throw new TypeError(cg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(LP(i,"prng")){if(!EP(i.prng))throw new TypeError(cg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=pa(n,{prng:i.prng})}else r=pa(n,i)}else r=pa(n)}return n===void 0?t=y:t=h,e=r.PRNG,Nt(t,"NAME","chi"),i&&i.prng?(Nt(t,"seed",null),Nt(t,"seedLength",null),OP(t,"state",RP(null),voe),Nt(t,"stateLength",null),Nt(t,"byteLength",null),Nt(t,"toJSON",RP(null))):(lg(t,"seed",a),lg(t,"seedLength",u),OP(t,"state",f,m),lg(t,"stateLength",o),lg(t,"byteLength",g),Nt(t,"toJSON",c)),Nt(t,"PRNG",e),t;function a(){return e.seed}function u(){return e.seedLength}function o(){return e.stateLength}function g(){return e.byteLength}function f(){return e.state}function m(d){e.state=d}function c(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=doe(e.state),n===void 0?d.params=[]:d.params=[n],d}function h(){return PP(r())}function y(d){return foe(d)||d<=0?NaN:PP(r(d))}}_P.exports=loe});var jP=s(function(T7e,TP){"use strict";var coe=jc(),moe=coe();TP.exports=moe});var Zs=s(function(j7e,xP){"use strict";var hoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),MP=jP(),poe=jc();hoe(MP,"factory",poe);xP.exports=MP});var VP=s(function(M7e,AP){"use strict";var yoe=require("@stdlib/assert/is-positive-number").isPrimitive,qoe=require("@stdlib/assert/is-positive-integer").isPrimitive,GP=require("@stdlib/string/format");function boe(r,e){return qoe(r)?yoe(e)?null:new TypeError(GP("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(GP("invalid argument. First argument must be a positive integer. Value: `%s`.",r))}AP.exports=boe});var WP=s(function(x7e,FP){"use strict";var woe=require("@stdlib/math/base/special/ln");function Soe(r,e,i){var t,n;for(t=1,n=0;n2){if(i=arguments[2],!zP(i))throw new TypeError(pg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(JP(i,"prng")){if(!kP(i.prng))throw new TypeError(pg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));e=i.prng}else e=hg(i)}else e=hg()}return a===void 0?t=d:t=y,Dr(t,"NAME","erlang"),i&&i.prng?(Dr(t,"seed",null),Dr(t,"seedLength",null),IP(t,"state",UP(null),Ooe),Dr(t,"stateLength",null),Dr(t,"byteLength",null),Dr(t,"toJSON",UP(null)),Dr(t,"PRNG",e)):(mg(t,"seed",u),mg(t,"seedLength",o),IP(t,"state",m,c),mg(t,"stateLength",g),mg(t,"byteLength",f),Dr(t,"toJSON",h),Dr(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function f(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function h(){var l={};return l.type="PRNG",l.name=t.NAME,l.state=Eoe(e.state),a===void 0?l.params=[]:l.params=[a,r],l}function y(){return BP(e,a,r)}function d(l,v){return CP(l)||CP(v)||!Noe(l)||v<=0?NaN:BP(e,l,v)}}XP.exports=Roe});var YP=s(function(A7e,DP){"use strict";var Poe=Mc(),_oe=Poe();DP.exports=_oe});var Qs=s(function(V7e,ZP){"use strict";var Toe=require("@stdlib/utils/define-nonenumerable-read-only-property"),HP=YP(),joe=Mc();Toe(HP,"factory",joe);ZP.exports=HP});var e_=s(function(F7e,KP){"use strict";var QP=require("@stdlib/assert/is-positive-number").isPrimitive,$P=require("@stdlib/string/format");function Moe(r,e){return QP(r)?QP(e)?null:new TypeError($P("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError($P("invalid argument. First argument must be a positive number. Value: `%s`.",r))}KP.exports=Moe});var t_=s(function(W7e,r_){"use strict";function xoe(r,e,i){var t=r(e)/e,n=r(i)/i;return t/n}r_.exports=xoe});var xc=s(function(I7e,v_){"use strict";var Et=require("@stdlib/utils/define-nonenumerable-read-only-property"),yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),i_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),n_=require("@stdlib/assert/is-plain-object"),a_=require("@stdlib/assert/is-function"),s_=require("@stdlib/assert/has-own-property"),u_=require("@stdlib/utils/constant-function"),Goe=require("@stdlib/utils/noop"),ya=Ot().factory,o_=require("@stdlib/math/base/assert/is-nan"),Aoe=require("@stdlib/array/to-json"),qg=require("@stdlib/string/format"),Voe=e_(),g_=t_();function Foe(){var r,e,i,t,n,a,u;if(arguments.length===0)r=ya();else if(arguments.length===1){if(e=arguments[0],!n_(e))throw new TypeError(qg("invalid argument. Options argument must be an object. Value: `%s`.",e));if(s_(e,"prng")){if(!a_(e.prng))throw new TypeError(qg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=ya({prng:e.prng})}else r=ya(e)}else{if(a=arguments[0],u=arguments[1],n=Voe(a,u),n)throw n;if(arguments.length>2){if(e=arguments[2],!n_(e))throw new TypeError(qg("invalid argument. Options argument must be an object. Value: `%s`.",e));if(s_(e,"prng")){if(!a_(e.prng))throw new TypeError(qg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=ya({prng:e.prng})}else r=ya(e)}else r=ya()}return a===void 0?t=l:t=d,i=r.PRNG,Et(t,"NAME","f"),e&&e.prng?(Et(t,"seed",null),Et(t,"seedLength",null),i_(t,"state",u_(null),Goe),Et(t,"stateLength",null),Et(t,"byteLength",null),Et(t,"toJSON",u_(null))):(yg(t,"seed",o),yg(t,"seedLength",g),i_(t,"state",c,h),yg(t,"stateLength",f),yg(t,"byteLength",m),Et(t,"toJSON",y)),Et(t,"PRNG",i),t;function o(){return i.seed}function g(){return i.seedLength}function f(){return i.stateLength}function m(){return i.byteLength}function c(){return i.state}function h(v){i.state=v}function y(){var v={};return v.type="PRNG",v.name=t.NAME,v.state=Aoe(i.state),a===void 0?v.params=[]:v.params=[a,u],v}function d(){return g_(r,a,u)}function l(v,p){return o_(v)||o_(p)||v<=0||p<=0?NaN:g_(r,v,p)}}v_.exports=Foe});var d_=s(function(z7e,f_){"use strict";var Woe=xc(),Ioe=Woe();f_.exports=Ioe});var $s=s(function(k7e,c_){"use strict";var zoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),l_=d_(),koe=xc();zoe(l_,"factory",koe);c_.exports=l_});var p_=s(function(J7e,h_){"use strict";var m_=require("@stdlib/assert/is-positive-number").isPrimitive,Joe=require("@stdlib/assert/is-number").isPrimitive,Gc=require("@stdlib/assert/is-nan"),Ac=require("@stdlib/string/format");function Uoe(r,e,i){return!m_(r)||Gc(r)?new TypeError(Ac("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r)):!m_(e)||Gc(e)?new TypeError(Ac("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e)):!Joe(i)||Gc(i)?new TypeError(Ac("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",i)):null}h_.exports=Uoe});var q_=s(function(U7e,y_){"use strict";var Coe=require("@stdlib/math/base/special/pow"),Boe=require("@stdlib/math/base/special/ln");function Xoe(r,e,i,t){return t+i*Coe(-Boe(r()),-1/e)}y_.exports=Xoe});var Fc=s(function(C7e,L_){"use strict";var Yr=require("@stdlib/utils/define-nonenumerable-read-only-property"),bg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),b_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),w_=require("@stdlib/assert/is-plain-object"),S_=require("@stdlib/assert/is-function"),O_=require("@stdlib/assert/has-own-property"),N_=require("@stdlib/utils/constant-function"),Doe=require("@stdlib/utils/noop"),wg=j().factory,Vc=require("@stdlib/math/base/assert/is-nan"),Yoe=require("@stdlib/array/to-json"),Sg=require("@stdlib/string/format"),Hoe=p_(),E_=q_();function Zoe(){var r,e,i,t,n,a,u;if(arguments.length===0)i=wg();else if(arguments.length===1){if(e=arguments[0],!w_(e))throw new TypeError(Sg("invalid argument. Options argument must be an object. Value: `%s`.",e));if(O_(e,"prng")){if(!S_(e.prng))throw new TypeError(Sg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=wg(e)}else{if(r=arguments[0],a=arguments[1],u=arguments[2],n=Hoe(r,a,u),n)throw n;if(arguments.length>3){if(e=arguments[3],!w_(e))throw new TypeError(Sg("invalid argument. Options argument must be an object. Value: `%s`.",e));if(O_(e,"prng")){if(!S_(e.prng))throw new TypeError(Sg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=wg(e)}else i=wg()}return r===void 0?t=l:t=d,Yr(t,"NAME","frechet"),e&&e.prng?(Yr(t,"seed",null),Yr(t,"seedLength",null),b_(t,"state",N_(null),Doe),Yr(t,"stateLength",null),Yr(t,"byteLength",null),Yr(t,"toJSON",N_(null)),Yr(t,"PRNG",i)):(bg(t,"seed",o),bg(t,"seedLength",g),b_(t,"state",c,h),bg(t,"stateLength",f),bg(t,"byteLength",m),Yr(t,"toJSON",y),Yr(t,"PRNG",i),i=i.normalized),t;function o(){return i.seed}function g(){return i.seedLength}function f(){return i.stateLength}function m(){return i.byteLength}function c(){return i.state}function h(v){i.state=v}function y(){var v={};return v.type="PRNG",v.name=t.NAME,v.state=Yoe(i.state),r===void 0?v.params=[]:v.params=[r,a,u],v}function d(){return E_(i,r,a,u)}function l(v,p,q){return Vc(v)||Vc(p)||Vc(q)||v<=0||p<=0?NaN:E_(i,v,p,q)}}L_.exports=Zoe});var P_=s(function(B7e,R_){"use strict";var Qoe=Fc(),$oe=Qoe();R_.exports=$oe});var Ks=s(function(X7e,T_){"use strict";var Koe=require("@stdlib/utils/define-nonenumerable-read-only-property"),__=P_(),ege=Fc();Koe(__,"factory",ege);T_.exports=__});var x_=s(function(D7e,M_){"use strict";var rge=require("@stdlib/assert/is-number").isPrimitive,tge=require("@stdlib/assert/is-positive-number").isPrimitive,j_=require("@stdlib/string/format"),ige=require("@stdlib/assert/is-nan");function nge(r,e){return!rge(r)||ige(r)?new TypeError(j_("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):tge(e)?null:new TypeError(j_("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}M_.exports=nge});var V_=s(function(Y7e,A_){"use strict";var G_=require("@stdlib/math/base/special/ln");function age(r,e,i){return e-i*G_(-G_(r()))}A_.exports=age});var Wc=s(function(H7e,C_){"use strict";var Hr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Og=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),F_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),W_=require("@stdlib/assert/is-plain-object"),I_=require("@stdlib/assert/is-function"),z_=require("@stdlib/assert/has-own-property"),k_=require("@stdlib/utils/constant-function"),sge=require("@stdlib/utils/noop"),Ng=j().factory,J_=require("@stdlib/math/base/assert/is-nan"),uge=require("@stdlib/array/to-json"),Eg=require("@stdlib/string/format"),oge=x_(),U_=V_();function gge(){var r,e,i,t,n,a;if(arguments.length===0)i=Ng();else if(arguments.length===1){if(e=arguments[0],!W_(e))throw new TypeError(Eg("invalid argument. Options argument must be an object. Value: `%s`.",e));if(z_(e,"prng")){if(!I_(e.prng))throw new TypeError(Eg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=Ng(e)}else{if(a=arguments[0],r=arguments[1],n=oge(a,r),n)throw n;if(arguments.length>2){if(e=arguments[2],!W_(e))throw new TypeError(Eg("invalid argument. Options argument must be an object. Value: `%s`.",e));if(z_(e,"prng")){if(!I_(e.prng))throw new TypeError(Eg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=Ng(e)}else i=Ng()}return a===void 0?t=d:t=y,Hr(t,"NAME","gumbel"),e&&e.prng?(Hr(t,"seed",null),Hr(t,"seedLength",null),F_(t,"state",k_(null),sge),Hr(t,"stateLength",null),Hr(t,"byteLength",null),Hr(t,"toJSON",k_(null)),Hr(t,"PRNG",i)):(Og(t,"seed",u),Og(t,"seedLength",o),F_(t,"state",m,c),Og(t,"stateLength",g),Og(t,"byteLength",f),Hr(t,"toJSON",h),Hr(t,"PRNG",i),i=i.normalized),t;function u(){return i.seed}function o(){return i.seedLength}function g(){return i.stateLength}function f(){return i.byteLength}function m(){return i.state}function c(l){i.state=l}function h(){var l={};return l.type="PRNG",l.name=t.NAME,l.state=uge(i.state),a===void 0?l.params=[]:l.params=[a,r],l}function y(){return U_(i,a,r)}function d(l,v){return J_(l)||J_(v)||v<=0?NaN:U_(i,l,v)}}C_.exports=gge});var X_=s(function(Z7e,B_){"use strict";var vge=Wc(),fge=vge();B_.exports=fge});var eu=s(function(Q7e,Y_){"use strict";var dge=require("@stdlib/utils/define-nonenumerable-read-only-property"),D_=X_(),lge=Wc();dge(D_,"factory",lge);Y_.exports=D_});var Z_=s(function($7e,H_){"use strict";var Ic=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ru=require("@stdlib/string/format");function cge(r,e,i){return Ic(r)?Ic(e)?Ic(i)?i>r?new RangeError(ru("invalid argument. Third argument must be less than or equal to the first argument. Value: `%u`.",i)):e>r?new RangeError(ru("invalid argument. Second argument must be less than or equal to the first argument. Value: `%u`.",e)):null:new TypeError(ru("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",i)):new TypeError(ru("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e)):new TypeError(ru("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r))}H_.exports=cge});var $_=s(function(K7e,Q_){"use strict";var Lt=require("@stdlib/math/base/special/factorial");function mge(r,e,i,t){var n,a,u;for(tn;)a-=n,n*=(e-u)*(t-u)/((u+1)*(i-t+1+u)),u+=1;return u}Q_.exports=mge});var eT=s(function(eDe,K_){"use strict";var Lg=$_();function hge(r,e,i,t){var n,a,u,o;return t>e/2?(u=e-t,2*i<=e?(n=i,a=e-i,o=Lg(r,n,a,u),i-o):(a=i,n=e-i,o=Lg(r,n,a,u),t-e+i+o)):(u=t,2*i<=e?(n=i,a=e-i,o=Lg(r,n,a,u),o):(n=e-i,a=i,o=Lg(r,n,a,u),t-o))}K_.exports=hge});var kc=s(function(rDe,oT){"use strict";var Zr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),rT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),tT=require("@stdlib/assert/is-plain-object"),iT=require("@stdlib/assert/is-function"),nT=require("@stdlib/assert/has-own-property"),aT=require("@stdlib/utils/constant-function"),pge=require("@stdlib/utils/noop"),Pg=j().factory,zc=require("@stdlib/math/base/assert/is-nonnegative-integer"),sT=require("@stdlib/constants/float64/pinf"),yge=require("@stdlib/array/to-json"),_g=require("@stdlib/string/format"),qge=Z_(),uT=eT();function bge(){var r,e,i,t,n,a,u;if(arguments.length===0)e=Pg();else if(arguments.length===1){if(r=arguments[0],!tT(r))throw new TypeError(_g("invalid argument. Options argument must be an object. Value: `%s`.",r));if(nT(r,"prng")){if(!iT(r.prng))throw new TypeError(_g("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Pg(r)}else{if(n=arguments[0],a=arguments[1],u=arguments[2],t=qge(n,a,u),t)throw t;if(arguments.length>3){if(r=arguments[3],!tT(r))throw new TypeError(_g("invalid argument. Options argument must be an object. Value: `%s`.",r));if(nT(r,"prng")){if(!iT(r.prng))throw new TypeError(_g("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Pg(r)}else e=Pg()}return n===void 0?i=l:i=d,Zr(i,"NAME","hypergeometric"),r&&r.prng?(Zr(i,"seed",null),Zr(i,"seedLength",null),rT(i,"state",aT(null),pge),Zr(i,"stateLength",null),Zr(i,"byteLength",null),Zr(i,"toJSON",aT(null)),Zr(i,"PRNG",e)):(Rg(i,"seed",o),Rg(i,"seedLength",g),rT(i,"state",c,h),Rg(i,"stateLength",f),Rg(i,"byteLength",m),Zr(i,"toJSON",y),Zr(i,"PRNG",e),e=e.normalized),i;function o(){return e.seed}function g(){return e.seedLength}function f(){return e.stateLength}function m(){return e.byteLength}function c(){return e.state}function h(v){e.state=v}function y(){var v={};return v.type="PRNG",v.name=i.NAME,v.state=yge(e.state),n===void 0?v.params=[]:v.params=[n,a,u],v}function d(){return uT(e,n,a,u)}function l(v,p,q){return v===sT||p===sT||!zc(v)||!zc(p)||!zc(q)||q>v?NaN:uT(e,v,p,q)}}oT.exports=bge});var vT=s(function(tDe,gT){"use strict";var wge=kc(),Sge=wge();gT.exports=Sge});var tu=s(function(iDe,dT){"use strict";var Oge=require("@stdlib/utils/define-nonenumerable-read-only-property"),fT=vT(),Nge=kc();Oge(fT,"factory",Nge);dT.exports=fT});var hT=s(function(nDe,mT){"use strict";var lT=require("@stdlib/assert/is-positive-number").isPrimitive,cT=require("@stdlib/string/format");function Ege(r,e){return lT(r)?lT(e)?null:new TypeError(cT("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(cT("invalid argument. First argument must be a positive number. Value: `%s`.",r))}mT.exports=Ege});var qT=s(function(aDe,yT){"use strict";var pT=require("@stdlib/math/base/special/pow");function Lge(r,e,i){var t=r();return pT(1-pT(1-t,1/i),1/e)}yT.exports=Lge});var Jc=s(function(sDe,RT){"use strict";var Qr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wT=require("@stdlib/assert/is-plain-object"),ST=require("@stdlib/assert/is-function"),OT=require("@stdlib/assert/has-own-property"),NT=require("@stdlib/utils/constant-function"),Rge=require("@stdlib/utils/noop"),jg=j().factory,ET=require("@stdlib/math/base/assert/is-nan"),Pge=require("@stdlib/array/to-json"),Mg=require("@stdlib/string/format"),_ge=hT(),LT=qT();function Tge(){var r,e,i,t,n,a;if(arguments.length===0)e=jg();else if(arguments.length===1){if(r=arguments[0],!wT(r))throw new TypeError(Mg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(OT(r,"prng")){if(!ST(r.prng))throw new TypeError(Mg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=jg(r)}else{if(n=arguments[0],a=arguments[1],t=_ge(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!wT(r))throw new TypeError(Mg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(OT(r,"prng")){if(!ST(r.prng))throw new TypeError(Mg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=jg(r)}else e=jg()}return n===void 0?i=d:i=y,Qr(i,"NAME","kumaraswamy"),r&&r.prng?(Qr(i,"seed",null),Qr(i,"seedLength",null),bT(i,"state",NT(null),Rge),Qr(i,"stateLength",null),Qr(i,"byteLength",null),Qr(i,"toJSON",NT(null)),Qr(i,"PRNG",e)):(Tg(i,"seed",u),Tg(i,"seedLength",o),bT(i,"state",m,c),Tg(i,"stateLength",g),Tg(i,"byteLength",f),Qr(i,"toJSON",h),Qr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function f(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function h(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=Pge(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return LT(e,n,a)}function d(l,v){return ET(l)||ET(v)||l<=0||v<=0?NaN:LT(e,l,v)}}RT.exports=Tge});var _T=s(function(uDe,PT){"use strict";var jge=Jc(),Mge=jge();PT.exports=Mge});var iu=s(function(oDe,jT){"use strict";var xge=require("@stdlib/utils/define-nonenumerable-read-only-property"),TT=_T(),Gge=Jc();xge(TT,"factory",Gge);jT.exports=TT});var GT=s(function(gDe,xT){"use strict";var Age=require("@stdlib/assert/is-number").isPrimitive,Vge=require("@stdlib/assert/is-positive-number").isPrimitive,MT=require("@stdlib/string/format"),Fge=require("@stdlib/assert/is-nan");function Wge(r,e){return!Age(r)||Fge(r)?new TypeError(MT("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Vge(e)?null:new TypeError(MT("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}xT.exports=Wge});var VT=s(function(vDe,AT){"use strict";var Ige=require("@stdlib/math/base/special/signum"),zge=require("@stdlib/math/base/special/abs"),kge=require("@stdlib/math/base/special/ln");function Jge(r,e,i){var t=r()-.5;return e-i*Ige(t)*kge(1-2*zge(t))}AT.exports=Jge});var Uc=s(function(fDe,CT){"use strict";var $r=require("@stdlib/utils/define-nonenumerable-read-only-property"),xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),FT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),WT=require("@stdlib/assert/is-plain-object"),IT=require("@stdlib/assert/is-function"),zT=require("@stdlib/assert/has-own-property"),kT=require("@stdlib/utils/constant-function"),Uge=require("@stdlib/utils/noop"),Gg=j().factory,JT=require("@stdlib/math/base/assert/is-nan"),Cge=require("@stdlib/array/to-json"),Ag=require("@stdlib/string/format"),Bge=GT(),UT=VT();function Xge(){var r,e,i,t,n,a;if(arguments.length===0)e=Gg();else if(arguments.length===1){if(r=arguments[0],!WT(r))throw new TypeError(Ag("invalid argument. Options argument must be an object. Value: `%s`.",r));if(zT(r,"prng")){if(!IT(r.prng))throw new TypeError(Ag("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Gg(r)}else{if(n=arguments[0],a=arguments[1],t=Bge(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!WT(r))throw new TypeError(Ag("invalid argument. Options argument must be an object. Value: `%s`.",r));if(zT(r,"prng")){if(!IT(r.prng))throw new TypeError(Ag("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Gg(r)}else e=Gg()}return n===void 0?i=d:i=y,$r(i,"NAME","laplace"),r&&r.prng?($r(i,"seed",null),$r(i,"seedLength",null),FT(i,"state",kT(null),Uge),$r(i,"stateLength",null),$r(i,"byteLength",null),$r(i,"toJSON",kT(null)),$r(i,"PRNG",e)):(xg(i,"seed",u),xg(i,"seedLength",o),FT(i,"state",m,c),xg(i,"stateLength",g),xg(i,"byteLength",f),$r(i,"toJSON",h),$r(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function f(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function h(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=Cge(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return UT(e,n,a)}function d(l,v){return JT(l)||JT(v)||v<=0?NaN:UT(e,l,v)}}CT.exports=Xge});var XT=s(function(dDe,BT){"use strict";var Dge=Uc(),Yge=Dge();BT.exports=Yge});var nu=s(function(lDe,YT){"use strict";var Hge=require("@stdlib/utils/define-nonenumerable-read-only-property"),DT=XT(),Zge=Uc();Hge(DT,"factory",Zge);YT.exports=DT});var QT=s(function(cDe,ZT){"use strict";var Qge=require("@stdlib/assert/is-number").isPrimitive,$ge=require("@stdlib/assert/is-positive-number").isPrimitive,HT=require("@stdlib/string/format"),Kge=require("@stdlib/assert/is-nan");function eve(r,e){return!Qge(r)||Kge(r)?new TypeError(HT("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):$ge(e)?null:new TypeError(HT("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}ZT.exports=eve});var KT=s(function(mDe,$T){"use strict";var rve=require("@stdlib/stats/base/dists/normal/quantile");function tve(r,e,i){var t=rve(1-r()/2,0,1);return e+i/(t*t)}$T.exports=tve});var Cc=s(function(hDe,u0){"use strict";var Kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),e0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),r0=require("@stdlib/assert/is-plain-object"),t0=require("@stdlib/assert/is-function"),i0=require("@stdlib/assert/has-own-property"),n0=require("@stdlib/utils/constant-function"),ive=require("@stdlib/utils/noop"),Fg=j().factory,a0=require("@stdlib/math/base/assert/is-nan"),nve=require("@stdlib/array/to-json"),Wg=require("@stdlib/string/format"),ave=QT(),s0=KT();function sve(){var r,e,i,t,n,a;if(arguments.length===0)e=Fg();else if(arguments.length===1){if(r=arguments[0],!r0(r))throw new TypeError(Wg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(i0(r,"prng")){if(!t0(r.prng))throw new TypeError(Wg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Fg(r)}else{if(n=arguments[0],a=arguments[1],t=ave(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!r0(r))throw new TypeError(Wg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(i0(r,"prng")){if(!t0(r.prng))throw new TypeError(Wg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Fg(r)}else e=Fg()}return n===void 0?i=d:i=y,Kr(i,"NAME","levy"),r&&r.prng?(Kr(i,"seed",null),Kr(i,"seedLength",null),e0(i,"state",n0(null),ive),Kr(i,"stateLength",null),Kr(i,"byteLength",null),Kr(i,"toJSON",n0(null)),Kr(i,"PRNG",e)):(Vg(i,"seed",u),Vg(i,"seedLength",o),e0(i,"state",m,c),Vg(i,"stateLength",g),Vg(i,"byteLength",f),Kr(i,"toJSON",h),Kr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function f(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function h(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=nve(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return s0(e,n,a)}function d(l,v){return a0(l)||a0(v)||v<=0?NaN:s0(e,l,v)}}u0.exports=sve});var g0=s(function(pDe,o0){"use strict";var uve=Cc(),ove=uve();o0.exports=ove});var au=s(function(yDe,f0){"use strict";var gve=require("@stdlib/utils/define-nonenumerable-read-only-property"),v0=g0(),vve=Cc();gve(v0,"factory",vve);f0.exports=v0});var c0=s(function(qDe,l0){"use strict";var fve=require("@stdlib/assert/is-number").isPrimitive,dve=require("@stdlib/assert/is-positive-number").isPrimitive,lve=require("@stdlib/assert/is-nan"),d0=require("@stdlib/string/format");function cve(r,e){return!fve(r)||lve(r)?new TypeError(d0("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):dve(e)?null:new TypeError(d0("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}l0.exports=cve});var h0=s(function(bDe,m0){"use strict";var mve=require("@stdlib/math/base/special/ln");function hve(r,e,i){var t=r();return e+i*mve(t/(1-t))}m0.exports=hve});var Bc=s(function(wDe,N0){"use strict";var et=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ig=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),p0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),y0=require("@stdlib/assert/is-plain-object"),q0=require("@stdlib/assert/is-function"),b0=require("@stdlib/assert/has-own-property"),w0=require("@stdlib/utils/constant-function"),pve=require("@stdlib/utils/noop"),zg=j().factory,S0=require("@stdlib/math/base/assert/is-nan"),yve=require("@stdlib/array/to-json"),kg=require("@stdlib/string/format"),qve=c0(),O0=h0();function bve(){var r,e,i,t,n,a;if(arguments.length===0)e=zg();else if(arguments.length===1){if(r=arguments[0],!y0(r))throw new TypeError(kg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(b0(r,"prng")){if(!q0(r.prng))throw new TypeError(kg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=zg(r)}else{if(n=arguments[0],a=arguments[1],t=qve(n,a),t)throw t;if(arguments.length>2){if(r=arguments[2],!y0(r))throw new TypeError(kg("invalid argument. Options argument must be an object. Value: `%s`.",r));if(b0(r,"prng")){if(!q0(r.prng))throw new TypeError(kg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=zg(r)}else e=zg()}return n===void 0?i=d:i=y,et(i,"NAME","logistic"),r&&r.prng?(et(i,"seed",null),et(i,"seedLength",null),p0(i,"state",w0(null),pve),et(i,"stateLength",null),et(i,"byteLength",null),et(i,"toJSON",w0(null)),et(i,"PRNG",e)):(Ig(i,"seed",u),Ig(i,"seedLength",o),p0(i,"state",m,c),Ig(i,"stateLength",g),Ig(i,"byteLength",f),et(i,"toJSON",h),et(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function g(){return e.stateLength}function f(){return e.byteLength}function m(){return e.state}function c(l){e.state=l}function h(){var l={};return l.type="PRNG",l.name=i.NAME,l.state=yve(e.state),n===void 0?l.params=[]:l.params=[n,a],l}function y(){return O0(e,n,a)}function d(l,v){return S0(l)||S0(v)||v<=0?NaN:O0(e,l,v)}}N0.exports=bve});var L0=s(function(SDe,E0){"use strict";var wve=Bc(),Sve=wve();E0.exports=Sve});var su=s(function(ODe,P0){"use strict";var Ove=require("@stdlib/utils/define-nonenumerable-read-only-property"),R0=L0(),Nve=Bc();Ove(R0,"factory",Nve);P0.exports=R0});var T0=s(function(NDe,_0){"use strict";var Eve=require("@stdlib/math/base/special/exp");function Lve(r,e){for(var i=r(),t=1;i>Eve(-e);)t+=1,i*=r();return t-1}_0.exports=Lve});var G0=s(function(EDe,x0){"use strict";var Rve=require("@stdlib/math/base/special/factorialln"),j0=require("@stdlib/math/base/special/floor"),Pve=require("@stdlib/math/base/special/signum"),_ve=require("@stdlib/math/base/special/sqrt"),M0=require("@stdlib/math/base/special/abs"),Jg=require("@stdlib/math/base/special/ln"),Tve=require("@stdlib/constants/float64/ln-sqrt-two-pi"),jve=1/12,Mve=1/360;function xve(r,e){var i,t,n,a,u,o,g,f,m,c;for(i=_ve(e),g=2.53*i+.931,o=.02483*g-.059,t=1.1328/(g-3.4)+1.1239,u=-3.6224/(g-2)+.9277,n=.86*u;;){if(c=r(),c<=n)return m=c/u-.43,m*=2*o/(.5-M0(m))+g,m+=e+.445,j0(m);if(c>=u?m=r()-.5:(m=c/u-.93,m=Pve(m)*.5-m,c=u*r()),a=.5-M0(m),(a>=.013||a>=c)&&(f=j0((2*o/a+g)*m+e+.445),c*=t/(o/(a*a)+g),m=(f+.5)*Jg(e/f),m+=-e-Tve+f,m-=(jve-Mve/(f*f))/f,f>=10&&m>=Jg(c*i)||(m=f*Jg(e)-e-Rve(f),f>=0&&f<=9&&m>=Jg(c))))return f}}x0.exports=xve});var V0=s(function(LDe,A0){"use strict";var Gve=T0(),Ave=G0();function Vve(r,e){return e<30?Gve(r,e):Ave(r,e)}A0.exports=Vve});var Xc=s(function(RDe,U0){"use strict";var rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ug=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),F0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Fve=require("@stdlib/assert/is-positive-number").isPrimitive,W0=require("@stdlib/assert/is-plain-object"),I0=require("@stdlib/assert/is-function"),z0=require("@stdlib/assert/has-own-property"),k0=require("@stdlib/utils/constant-function"),Wve=require("@stdlib/utils/noop"),Cg=j().factory,Ive=require("@stdlib/math/base/assert/is-nan"),zve=require("@stdlib/array/to-json"),Bg=require("@stdlib/string/format"),J0=V0();function kve(){var r,e,i,t;if(arguments.length===0)i=Cg();else if(arguments.length===1&&W0(arguments[0]))if(e=arguments[0],z0(e,"prng")){if(!I0(e.prng))throw new TypeError(Bg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=Cg(e);else{if(r=arguments[0],!Fve(r))throw new TypeError(Bg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!W0(e))throw new TypeError(Bg("invalid argument. Options argument must be an object. Value: `%s`.",e));if(z0(e,"prng")){if(!I0(e.prng))throw new TypeError(Bg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=Cg(e)}else i=Cg()}return r===void 0?t=h:t=c,rt(t,"NAME","poisson"),e&&e.prng?(rt(t,"seed",null),rt(t,"seedLength",null),F0(t,"state",k0(null),Wve),rt(t,"stateLength",null),rt(t,"byteLength",null),rt(t,"toJSON",k0(null)),rt(t,"PRNG",i)):(Ug(t,"seed",n),Ug(t,"seedLength",a),F0(t,"state",g,f),Ug(t,"stateLength",u),Ug(t,"byteLength",o),rt(t,"toJSON",m),rt(t,"PRNG",i),i=i.normalized),t;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function f(y){i.state=y}function m(){var y={};return y.type="PRNG",y.name=t.NAME,y.state=zve(i.state),r===void 0?y.params=[]:y.params=[r],y}function c(){return J0(i,r)}function h(y){return Ive(y)||y<=0?NaN:J0(i,y)}}U0.exports=kve});var B0=s(function(PDe,C0){"use strict";var Jve=Xc(),Uve=Jve();C0.exports=Uve});var qa=s(function(_De,D0){"use strict";var Cve=require("@stdlib/utils/define-nonenumerable-read-only-property"),X0=B0(),Bve=Xc();Cve(X0,"factory",Bve);D0.exports=X0});var H0=s(function(TDe,Y0){"use strict";var Xve=require("@stdlib/assert/is-positive-number").isPrimitive,Dve=require("@stdlib/assert/is-number").isPrimitive,Dc=require("@stdlib/string/format"),Yve=require("@stdlib/assert/is-nan");function Hve(r,e){return Xve(r)?!Dve(e)||Yve(e)?new TypeError(Dc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):e<=0||e>=1?new RangeError(Dc("invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.",e)):null:new TypeError(Dc("invalid argument. First argument must be a positive number. Value: `%s`.",r))}Y0.exports=Hve});var Qc=s(function(jDe,ij){"use strict";var Rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Z0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ba=require("@stdlib/assert/has-own-property"),Q0=require("@stdlib/assert/is-plain-object"),Yc=require("@stdlib/assert/is-uint32array"),$0=require("@stdlib/assert/is-boolean").isPrimitive,K0=require("@stdlib/assert/is-function"),ej=require("@stdlib/utils/constant-function"),Zve=require("@stdlib/utils/noop"),rj=require("@stdlib/math/base/assert/is-nan"),wa=qa().factory,Dg=ke().factory,Hc=require("@stdlib/blas/base/gcopy"),Zc=require("@stdlib/array/uint32"),tj=require("@stdlib/object/assign"),Qve=require("@stdlib/array/to-json"),tt=require("@stdlib/string/format"),$ve=H0();function Kve(){var r,e,i,t,n,a,u,o,g,f;if(u=!0,arguments.length===0)t={copy:!1},i=wa(t);else if(arguments.length===1){if(t=arguments[0],!Q0(t))throw new TypeError(tt("invalid argument. Options argument must be an object. Value: `%s`.",t));if(ba(t,"copy")&&!$0(t.copy))throw new TypeError(tt("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",t.copy));if(ba(t,"prng")){if(!K0(t.prng))throw new TypeError(tt("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=wa({prng:t.prng})}else{if(ba(t,"state")&&!Yc(t.state))throw new TypeError(tt("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",t.state));t=tj({},t),t.copy===!1?u=!1:t.state&&(t.state=Hc(t.state.length,t.state,1,new Zc(t.state.length),1)),t.copy=!1,i=wa(t)}}else{if(f=arguments[0],g=arguments[1],o=$ve(f,g),o)throw o;if(arguments.length>2){if(t=arguments[2],!Q0(t))throw new TypeError(tt("invalid argument. Options argument must be an object. Value: `%s`.",t));if(ba(t,"copy")&&!$0(t.copy))throw new TypeError(tt("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",t.copy));if(ba(t,"prng")){if(!K0(t.prng))throw new TypeError(tt("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=wa({prng:t.prng})}else{if(ba(t,"state")&&!Yc(t.state))throw new TypeError(tt("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",t.state));t=tj({},t),t.copy===!1?u=!1:t.state&&(t.state=Hc(t.state.length,t.state,1,new Zc(t.state.length),1)),t.copy=!1,i=wa(t)}}else t={copy:!1},i=wa(t)}return t&&t.prng?f===void 0?r=Dg({prng:t.prng}):r=Dg(f,g/(1-g),{prng:t.prng}):(t.state?e=t.state:(e=i.state,i.state=e),f===void 0?r=Dg({state:e,copy:!1}):r=Dg(f,g/(1-g),{state:e,copy:!1})),f===void 0?n=q:n=p,a=i.PRNG,Rt(n,"NAME","negative-binomial"),t&&t.prng?(Rt(n,"seed",null),Rt(n,"seedLength",null),Z0(n,"state",ej(null),Zve),Rt(n,"stateLength",null),Rt(n,"byteLength",null),Rt(n,"toJSON",ej(null))):(Xg(n,"seed",m),Xg(n,"seedLength",c),Z0(n,"state",d,l),Xg(n,"stateLength",h),Xg(n,"byteLength",y),Rt(n,"toJSON",v)),Rt(n,"PRNG",a),n;function m(){return a.seed}function c(){return a.seedLength}function h(){return a.stateLength}function y(){return a.byteLength}function d(){return a.state}function l(b){if(!Yc(b))throw new TypeError(tt("invalid argument. Must provide a Uint32Array. Value: `%s`.",b));u&&(b=Hc(b.length,b,1,new Zc(b.length),1)),a.state=b}function v(){var b={};return b.type="PRNG",b.name=n.NAME,b.state=Qve(a.state),f===void 0?b.params=[]:b.params=[f,g],b}function p(){return i(r())}function q(b,w){return rj(b)||rj(w)||w<=0||w>=1?NaN:i(r(b,w/(1-w)))}}ij.exports=Kve});var aj=s(function(MDe,nj){"use strict";var efe=Qc(),rfe=efe();nj.exports=rfe});var uu=s(function(xDe,uj){"use strict";var tfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),sj=aj(),ife=Qc();tfe(sj,"factory",ife);uj.exports=sj});var fj=s(function(GDe,vj){"use strict";var oj=require("@stdlib/assert/is-positive-number").isPrimitive,gj=require("@stdlib/string/format");function nfe(r,e){return oj(r)?oj(e)?null:new TypeError(gj("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(gj("invalid argument. First argument must be a positive number. Value: `%s`.",r))}vj.exports=nfe});var lj=s(function(ADe,dj){"use strict";var afe=require("@stdlib/math/base/special/pow");function sfe(r,e,i){return i/afe(r(),1/e)}dj.exports=sfe});var $c=s(function(VDe,wj){"use strict";var it=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),mj=require("@stdlib/assert/is-plain-object"),hj=require("@stdlib/assert/is-function"),pj=require("@stdlib/assert/has-own-property"),yj=require("@stdlib/utils/constant-function"),ufe=require("@stdlib/utils/noop"),Hg=j().factory,qj=require("@stdlib/math/base/assert/is-nan"),ofe=require("@stdlib/array/to-json"),Zg=require("@stdlib/string/format"),gfe=fj(),bj=lj();function vfe(){var r,e,i,t,n,a;if(arguments.length===0)t=Hg();else if(arguments.length===1){if(i=arguments[0],!mj(i))throw new TypeError(Zg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(pj(i,"prng")){if(!hj(i.prng))throw new TypeError(Zg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=i.prng}else t=Hg(i)}else{if(r=arguments[0],e=arguments[1],a=gfe(r,e),a)throw a;if(arguments.length>2){if(i=arguments[2],!mj(i))throw new TypeError(Zg("invalid argument. Options argument must be an object. Value: `%s`.",i));if(pj(i,"prng")){if(!hj(i.prng))throw new TypeError(Zg("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=i.prng}else t=Hg(i)}else t=Hg()}return r===void 0?n=d:n=y,it(n,"NAME","pareto-type1"),i&&i.prng?(it(n,"seed",null),it(n,"seedLength",null),cj(n,"state",yj(null),ufe),it(n,"stateLength",null),it(n,"byteLength",null),it(n,"toJSON",yj(null)),it(n,"PRNG",t)):(Yg(n,"seed",u),Yg(n,"seedLength",o),cj(n,"state",m,c),Yg(n,"stateLength",g),Yg(n,"byteLength",f),it(n,"toJSON",h),it(n,"PRNG",t),t=t.normalized),n;function u(){return t.seed}function o(){return t.seedLength}function g(){return t.stateLength}function f(){return t.byteLength}function m(){return t.state}function c(l){t.state=l}function h(){var l={};return l.type="PRNG",l.name=n.NAME,l.state=ofe(t.state),r===void 0?l.params=[]:l.params=[r,e],l}function y(){return bj(t,r,e)}function d(l,v){return qj(l)||qj(v)||l<=0||v<=0?NaN:bj(t,l,v)}}wj.exports=vfe});var Oj=s(function(FDe,Sj){"use strict";var ffe=$c(),dfe=ffe();Sj.exports=dfe});var ou=s(function(WDe,Ej){"use strict";var lfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nj=Oj(),cfe=$c();lfe(Nj,"factory",cfe);Ej.exports=Nj});var Lj=s(function(IDe,mfe){mfe.exports={name:"mt19937",copy:!0}});var Pj=s(function(zDe,Rj){"use strict";var hfe=Z(),pfe=$(),yfe=j(),Qg={};Qg.minstd=hfe;Qg["minstd-shuffle"]=pfe;Qg.mt19937=yfe;Rj.exports=Qg});var Kc=s(function(kDe,Tj){"use strict";var gu=require("@stdlib/utils/define-nonenumerable-read-only-property"),$g=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qfe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bfe=require("@stdlib/assert/is-plain-object"),wfe=require("@stdlib/assert/is-boolean").isPrimitive,Kg=require("@stdlib/assert/has-own-property"),Sfe=require("@stdlib/array/to-json"),vu=require("@stdlib/string/format"),_j=Lj(),Ofe=Pj();function Nfe(r){var e,i,t;if(e={name:_j.name,copy:_j.copy},arguments.length){if(!bfe(r))throw new TypeError(vu("invalid argument. Must provide an object. Value: `%s`.",r));if(Kg(r,"name")&&(e.name=r.name),Kg(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(vu("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(Kg(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(vu("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(Kg(r,"copy")&&(e.copy=r.copy,!wfe(e.copy)))throw new TypeError(vu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(t=Ofe[e.name],t===void 0)throw new Error(vu("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.state===void 0?e.seed===void 0?i=t.factory():i=t.factory({seed:e.seed}):i=t.factory({state:e.state,copy:e.copy}),gu(c,"NAME","randi"),$g(c,"seed",n),$g(c,"seedLength",a),qfe(c,"state",g,f),$g(c,"stateLength",u),$g(c,"byteLength",o),gu(c,"toJSON",m),gu(c,"PRNG",i),gu(c,"MIN",i.MIN),gu(c,"MAX",i.MAX),c;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function f(h){i.state=h}function m(){var h={};return h.type="PRNG",h.name=c.NAME+"-"+i.NAME,h.state=Sfe(i.state),h.params=[],h}function c(){return i()}}Tj.exports=Nfe});var Mj=s(function(JDe,jj){"use strict";var Efe=Kc(),Lfe=Efe();jj.exports=Lfe});var fu=s(function(UDe,Gj){"use strict";var Rfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),xj=Mj(),Pfe=Kc();Rfe(xj,"factory",Pfe);Gj.exports=xj});var Aj=s(function(CDe,_fe){_fe.exports={name:"improved-ziggurat",copy:!0}});var Fj=s(function(BDe,Vj){"use strict";var Tfe=ca(),jfe=H(),em={};em["box-muller"]=Tfe;em["improved-ziggurat"]=jfe;Vj.exports=em});var rm=s(function(XDe,kj){"use strict";var Pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ev=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Wj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Mfe=require("@stdlib/assert/is-plain-object"),xfe=require("@stdlib/assert/is-boolean").isPrimitive,du=require("@stdlib/assert/has-own-property"),Ij=require("@stdlib/utils/constant-function"),Sa=require("@stdlib/string/format"),Gfe=require("@stdlib/utils/noop"),Afe=require("@stdlib/array/to-json"),zj=Aj(),Vfe=Fj();function Ffe(r){var e,i,t;if(e={name:zj.name,copy:zj.copy},arguments.length){if(!Mfe(r))throw new TypeError(Sa("invalid argument. Must provide an object. Value: `%s`.",r));if(du(r,"name")&&(e.name=r.name),du(r,"prng")){if(e.prng=r.prng,e.prng===void 0)throw new TypeError(Sa("invalid option. `%s` option cannot be undefined. Option: `%s`.","prng",e.prng))}else if(du(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(Sa("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(du(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(Sa("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(du(r,"copy")&&(e.copy=r.copy,!xfe(e.copy)))throw new TypeError(Sa("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(t=Vfe[e.name],t===void 0)throw new Error(Sa("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.prng===void 0?e.state===void 0?e.seed===void 0?i=t.factory():i=t.factory({seed:e.seed}):i=t.factory({state:e.state,copy:e.copy}):i=t.factory({prng:e.prng}),Pt(c,"NAME","randn"),e.prng?(Pt(c,"seed",null),Pt(c,"seedLength",null),Wj(c,"state",Ij(null),Gfe),Pt(c,"stateLength",null),Pt(c,"byteLength",null),Pt(c,"toJSON",Ij(null))):(ev(c,"seed",n),ev(c,"seedLength",a),Wj(c,"state",g,f),ev(c,"stateLength",u),ev(c,"byteLength",o),Pt(c,"toJSON",m)),Pt(c,"PRNG",i.PRNG),c;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function f(h){i.state=h}function m(){var h={};return h.type="PRNG",h.name=c.NAME+"-"+i.NAME,h.state=Afe(i.state),h.params=[],h}function c(){return i()}}kj.exports=Ffe});var Uj=s(function(DDe,Jj){"use strict";var Wfe=rm(),Ife=Wfe();Jj.exports=Ife});var lu=s(function(YDe,Bj){"use strict";var zfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cj=Uj(),kfe=rm();zfe(Cj,"factory",kfe);Bj.exports=Cj});var Dj=s(function(HDe,Xj){"use strict";var Jfe=require("@stdlib/math/base/special/sqrt"),Ufe=require("@stdlib/math/base/special/ln");function Cfe(r,e){return e*Jfe(-2*Ufe(r()))}Xj.exports=Cfe});var tm=s(function(ZDe,eM){"use strict";var nt=require("@stdlib/utils/define-nonenumerable-read-only-property"),rv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Yj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Bfe=require("@stdlib/assert/is-positive-number").isPrimitive,Hj=require("@stdlib/assert/is-plain-object"),Zj=require("@stdlib/assert/is-function"),Qj=require("@stdlib/assert/has-own-property"),$j=require("@stdlib/utils/constant-function"),Xfe=require("@stdlib/utils/noop"),tv=j().factory,Dfe=require("@stdlib/math/base/assert/is-nan"),Yfe=require("@stdlib/array/to-json"),iv=require("@stdlib/string/format"),Kj=Dj();function Hfe(){var r,e,i,t;if(arguments.length===0)i=tv();else if(arguments.length===1&&Hj(arguments[0]))if(e=arguments[0],Qj(e,"prng")){if(!Zj(e.prng))throw new TypeError(iv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=tv(e);else{if(r=arguments[0],!Bfe(r))throw new TypeError(iv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!Hj(e))throw new TypeError(iv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(Qj(e,"prng")){if(!Zj(e.prng))throw new TypeError(iv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=tv(e)}else i=tv()}return r===void 0?t=h:t=c,nt(t,"NAME","rayleigh"),e&&e.prng?(nt(t,"seed",null),nt(t,"seedLength",null),Yj(t,"state",$j(null),Xfe),nt(t,"stateLength",null),nt(t,"byteLength",null),nt(t,"toJSON",$j(null)),nt(t,"PRNG",i)):(rv(t,"seed",n),rv(t,"seedLength",a),Yj(t,"state",g,f),rv(t,"stateLength",u),rv(t,"byteLength",o),nt(t,"toJSON",m),nt(t,"PRNG",i),i=i.normalized),t;function n(){return i.seed}function a(){return i.seedLength}function u(){return i.stateLength}function o(){return i.byteLength}function g(){return i.state}function f(y){i.state=y}function m(){var y={};return y.type="PRNG",y.name=t.NAME,y.state=Yfe(i.state),r===void 0?y.params=[]:y.params=[r],y}function c(){return Kj(i,r)}function h(y){return Dfe(y)||y<=0?NaN:Kj(i,y)}}eM.exports=Hfe});var tM=s(function(QDe,rM){"use strict";var Zfe=tm(),Qfe=Zfe();rM.exports=Qfe});var cu=s(function($De,nM){"use strict";var $fe=require("@stdlib/utils/define-nonenumerable-read-only-property"),iM=tM(),Kfe=tm();$fe(iM,"factory",Kfe);nM.exports=iM});var sm=s(function(KDe,lM){"use strict";var _t=require("@stdlib/utils/define-nonenumerable-read-only-property"),nv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),aM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Oa=require("@stdlib/assert/has-own-property"),sM=require("@stdlib/assert/is-positive-number").isPrimitive,uM=require("@stdlib/assert/is-plain-object"),im=require("@stdlib/assert/is-uint32array"),oM=require("@stdlib/assert/is-boolean").isPrimitive,ede=require("@stdlib/math/base/assert/is-nan"),gM=require("@stdlib/assert/is-function"),vM=require("@stdlib/utils/constant-function"),rde=require("@stdlib/utils/noop"),av=Ot().factory,Na=H().factory,nm=require("@stdlib/blas/base/gcopy"),am=require("@stdlib/array/uint32"),fM=require("@stdlib/object/assign"),tde=require("@stdlib/array/to-json"),Be=require("@stdlib/string/format"),dM=require("@stdlib/math/base/special/sqrt");function ide(){var r,e,i,t,n,a,u,o;if(u=!0,arguments.length===0)n={copy:!1},i=Na(n);else if(arguments.length===1)if(uM(arguments[0])){if(n=arguments[0],Oa(n,"copy")&&!oM(n.copy))throw new TypeError(Be("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Oa(n,"prng")){if(!gM(n.prng))throw new TypeError(Be("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));i=Na({prng:n.prng})}else{if(Oa(n,"state")&&!im(n.state))throw new TypeError(Be("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=fM({},n),n.copy===!1?u=!1:n.state&&(n.state=nm(n.state.length,n.state,1,new am(n.state.length),1)),n.copy=!1,i=Na(n)}}else{if(o=arguments[0],!sM(o))throw new TypeError(Be("invalid argument. First argument must be a positive number or an options object. Value: `%s`.",o));n={copy:!1},i=Na(n)}else{if(o=arguments[0],!sM(o))throw new TypeError(Be("invalid argument. First argument must be a positive number. Value: `%s`.",o));if(n=arguments[1],!uM(n))throw new TypeError(Be("invalid argument. Options argument must be an object. Value: `%s`.",n));if(Oa(n,"copy")&&!oM(n.copy))throw new TypeError(Be("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Oa(n,"prng")){if(!gM(n.prng))throw new TypeError(Be("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));i=Na({prng:n.prng})}else{if(Oa(n,"state")&&!im(n.state))throw new TypeError(Be("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=fM({},n),n.copy===!1?u=!1:n.state&&(n.state=nm(n.state.length,n.state,1,new am(n.state.length),1)),n.copy=!1,i=Na(n)}}return n&&n.prng?o===void 0?r=av({prng:n.prng}):r=av(o,{prng:n.prng}):(n.state?e=n.state:(e=i.state,i.state=e),o===void 0?r=av({state:e,copy:!1}):r=av(o,{state:e,copy:!1})),o===void 0?a=v:a=l,t=i.PRNG,_t(a,"NAME","t"),n&&n.prng?(_t(a,"seed",null),_t(a,"seedLength",null),aM(a,"state",vM(null),rde),_t(a,"stateLength",null),_t(a,"byteLength",null),_t(a,"toJSON",vM(null))):(nv(a,"seed",g),nv(a,"seedLength",f),aM(a,"state",h,y),nv(a,"stateLength",m),nv(a,"byteLength",c),_t(a,"toJSON",d)),_t(a,"PRNG",t),a;function g(){return t.seed}function f(){return t.seedLength}function m(){return t.stateLength}function c(){return t.byteLength}function h(){return t.state}function y(p){if(!im(p))throw new TypeError(Be("invalid argument. Must provide a Uint32Array. Value: `%s`.",p));u&&(p=nm(p.length,p,1,new am(p.length),1)),t.state=p}function d(){var p={};return p.type="PRNG",p.name=a.NAME,p.state=tde(t.state),o===void 0?p.params=[]:p.params=[o],p}function l(){return i()/dM(r()/o)}function v(p){return ede(p)||p<=0?NaN:i()/dM(r(p)/p)}}lM.exports=ide});var mM=s(function(e5e,cM){"use strict";var nde=sm(),ade=nde();cM.exports=ade});var mu=s(function(r5e,pM){"use strict";var sde=require("@stdlib/utils/define-nonenumerable-read-only-property"),hM=mM(),ude=sm();sde(hM,"factory",ude);pM.exports=hM});var qM=s(function(t5e,yM){"use strict";var um=require("@stdlib/assert/is-number").isPrimitive,sv=require("@stdlib/string/format"),om=require("@stdlib/assert/is-nan");function ode(r,e,i){return!um(r)||om(r)?new TypeError(sv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!um(e)||om(e)?new TypeError(sv("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):!um(i)||om(i)?new TypeError(sv("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",i)):r<=i&&i<=e?null:new RangeError(sv("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,i))}yM.exports=ode});var SM=s(function(i5e,wM){"use strict";var bM=require("@stdlib/math/base/special/sqrt");function gde(r,e,i,t){var n,a,u;return n=(t-e)/(i-e),u=r(),u3){if(r=arguments[3],!NM(r))throw new TypeError(gv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(LM(r,"prng")){if(!EM(r.prng))throw new TypeError(gv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ov(r)}else e=ov()}return n===void 0?i=l:i=d,at(i,"NAME","triangular"),r&&r.prng?(at(i,"seed",null),at(i,"seedLength",null),OM(i,"state",RM(null),vde),at(i,"stateLength",null),at(i,"byteLength",null),at(i,"toJSON",RM(null)),at(i,"PRNG",e)):(uv(i,"seed",o),uv(i,"seedLength",g),OM(i,"state",c,h),uv(i,"stateLength",f),uv(i,"byteLength",m),at(i,"toJSON",y),at(i,"PRNG",e),e=e.normalized),i;function o(){return e.seed}function g(){return e.seedLength}function f(){return e.stateLength}function m(){return e.byteLength}function c(){return e.state}function h(v){e.state=v}function y(){var v={};return v.type="PRNG",v.name=i.NAME,v.state=fde(e.state),n===void 0?v.params=[]:v.params=[n,a,u],v}function d(){return PM(e,n,a,u)}function l(v,p,q){return gm(v)||gm(p)||gm(q)||!(v<=q&&q<=p)?NaN:PM(e,v,p,q)}}_M.exports=lde});var jM=s(function(a5e,TM){"use strict";var cde=vm(),mde=cde();TM.exports=mde});var hu=s(function(s5e,xM){"use strict";var hde=require("@stdlib/utils/define-nonenumerable-read-only-property"),MM=jM(),pde=vm();hde(MM,"factory",pde);xM.exports=MM});var FM=s(function(u5e,VM){"use strict";var GM=require("@stdlib/assert/is-positive-number").isPrimitive,AM=require("@stdlib/string/format");function yde(r,e){return GM(r)?GM(e)?null:new TypeError(AM("invalid argument. Shape parameter must be a positive number. Value: `%s`.",e)):new TypeError(AM("invalid argument. Scale parameter must be a positive number. Value: `%s`.",r))}VM.exports=yde});var IM=s(function(o5e,WM){"use strict";var qde=require("@stdlib/math/base/special/pow"),bde=require("@stdlib/math/base/special/ln");function wde(r,e,i){return i*qde(-bde(1-r()),1/e)}WM.exports=wde});var fm=s(function(g5e,DM){"use strict";var st=require("@stdlib/utils/define-nonenumerable-read-only-property"),vv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),zM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kM=require("@stdlib/assert/is-plain-object"),JM=require("@stdlib/assert/is-function"),UM=require("@stdlib/assert/has-own-property"),CM=require("@stdlib/utils/constant-function"),Sde=require("@stdlib/utils/noop"),fv=j().factory,BM=require("@stdlib/math/base/assert/is-nan"),Ode=require("@stdlib/array/to-json"),dv=require("@stdlib/string/format"),Nde=FM(),XM=IM();function Ede(){var r,e,i,t,n,a;if(arguments.length===0)i=fv();else if(arguments.length===1){if(e=arguments[0],!kM(e))throw new TypeError(dv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(UM(e,"prng")){if(!JM(e.prng))throw new TypeError(dv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=fv(e)}else{if(a=arguments[0],r=arguments[1],n=Nde(r,a),n)throw n;if(arguments.length>2){if(e=arguments[2],!kM(e))throw new TypeError(dv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(UM(e,"prng")){if(!JM(e.prng))throw new TypeError(dv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));i=e.prng}else i=fv(e)}else i=fv()}return r===void 0?t=d:t=y,st(t,"NAME","weibull"),e&&e.prng?(st(t,"seed",null),st(t,"seedLength",null),zM(t,"state",CM(null),Sde),st(t,"stateLength",null),st(t,"byteLength",null),st(t,"toJSON",CM(null)),st(t,"PRNG",i)):(vv(t,"seed",u),vv(t,"seedLength",o),zM(t,"state",m,c),vv(t,"stateLength",g),vv(t,"byteLength",f),st(t,"toJSON",h),st(t,"PRNG",i),i=i.normalized),t;function u(){return i.seed}function o(){return i.seedLength}function g(){return i.stateLength}function f(){return i.byteLength}function m(){return i.state}function c(l){i.state=l}function h(){var l={};return l.type="PRNG",l.name=t.NAME,l.state=Ode(i.state),a===void 0?l.params=[]:l.params=[a,r],l}function y(){return XM(i,a,r)}function d(l,v){return BM(l)||BM(v)||l<=0||v<=0?NaN:XM(i,l,v)}}DM.exports=Ede});var HM=s(function(v5e,YM){"use strict";var Lde=fm(),Rde=Lde();YM.exports=Rde});var Ea=s(function(f5e,QM){"use strict";var Pde=require("@stdlib/utils/define-nonenumerable-read-only-property"),ZM=HM(),_de=fm();Pde(ZM,"factory",_de);QM.exports=ZM});var KM=s(function(d5e,$M){"use strict";var Tde=en(),jde=Bs(),Mde=tn(),xde=nn(),Gde=Xs(),Ade=ca(),Vde=Hs(),Fde=Zs(),Wde=Ot(),Ide=an(),zde=sn(),kde=Qs(),Jde=un(),Ude=$s(),Cde=Ks(),Bde=ke(),Xde=ua(),Dde=eu(),Yde=tu(),Hde=H(),Zde=on(),Qde=iu(),$de=nu(),Kde=au(),ele=su(),rle=gn(),tle=Z(),ile=$(),nle=j(),ale=uu(),sle=vn(),ule=ou(),ole=qa(),gle=fu(),vle=lu(),fle=bt(),dle=cu(),lle=mu(),cle=hu(),mle=fn(),hle=Ea(),E={};E.arcsine=Tde.factory;E.bernoulli=jde.factory;E.beta=Mde.factory;E.betaprime=xde.factory;E.binomial=Gde.factory;E["box-muller"]=Ade.factory;E.cauchy=Vde.factory;E.chi=Fde.factory;E.chisquare=Wde.factory;E.cosine=Ide.factory;E["discrete-uniform"]=zde.factory;E.erlang=kde.factory;E.exponential=Jde.factory;E.f=Ude.factory;E.frechet=Cde.factory;E.gamma=Bde.factory;E.geometric=Xde.factory;E.gumbel=Dde.factory;E.hypergeometric=Yde.factory;E["improved-ziggurat"]=Hde.factory;E.invgamma=Zde.factory;E.kumaraswamy=Qde.factory;E.laplace=$de.factory;E.levy=Kde.factory;E.logistic=ele.factory;E.lognormal=rle.factory;E.minstd=tle.factory;E["minstd-shuffle"]=ile.factory;E.mt19937=nle.factory;E["negative-binomial"]=ale.factory;E.normal=sle.factory;E["pareto-type1"]=ule.factory;E.poisson=ole.factory;E.randi=gle.factory;E.randn=vle.factory;E.randu=fle.factory;E.rayleigh=dle.factory;E.t=lle.factory;E.triangular=cle.factory;E.uniform=mle.factory;E.weibull=hle.factory;$M.exports=E});var n1=s(function(l5e,i1){"use strict";var e1=require("@stdlib/assert/is-string").isPrimitive,ple=require("@stdlib/assert/is-plain-object"),r1=require("@stdlib/assert/is-array"),yle=require("@stdlib/assert/contains"),qle=require("@stdlib/array/int32"),ble=require("@stdlib/array/uint32"),t1=KM(),wle={Int32Array:qle,Uint32Array:ble},Sle=["randi","randn","randu"];function Ole(r,e){var i,t,n,a,u;if(e&&e.type==="PRNG"&&e1(e.name)&&ple(e.state)&&r1(e.params)&&e1(e.state.type)&&r1(e.state.data)&&(t={},i=t1[e.name],i===void 0&&(u=e.name.split("-"),yle(Sle,u[0])&&(i=t1[u[0]],t.name=u.slice(1).join("-"))),i&&(a=wle[e.state.type],a))){t.state=new a(e.state.data),n=e.params.slice(),n.push(t);try{return i.apply(null,n)}catch(o){}}return e}i1.exports=Ole});var s1=s(function(c5e,a1){"use strict";var Nle=n1();a1.exports=Nle});var o1=s(function(m5e,u1){"use strict";var L=require("@stdlib/utils/define-read-only-property"),N={};L(N,"arcsine",en());L(N,"bernoulli",Bs());L(N,"beta",tn());L(N,"betaprime",nn());L(N,"binomial",Xs());L(N,"boxMuller",ca());L(N,"cauchy",Hs());L(N,"chi",Zs());L(N,"chisquare",Ot());L(N,"cosine",an());L(N,"discreteUniform",sn());L(N,"erlang",Qs());L(N,"exponential",un());L(N,"f",$s());L(N,"frechet",Ks());L(N,"gamma",ke());L(N,"geometric",ua());L(N,"gumbel",eu());L(N,"hypergeometric",tu());L(N,"improvedZiggurat",H());L(N,"invgamma",on());L(N,"kumaraswamy",iu());L(N,"laplace",nu());L(N,"levy",au());L(N,"logistic",su());L(N,"lognormal",gn());L(N,"minstd",Z());L(N,"minstdShuffle",$());L(N,"mt19937",j());L(N,"negativeBinomial",uu());L(N,"normal",vn());L(N,"pareto1",ou());L(N,"poisson",qa());L(N,"randi",fu());L(N,"randn",lu());L(N,"randu",bt());L(N,"rayleigh",cu());L(N,"reviveBasePRNG",s1());L(N,"t",mu());L(N,"triangular",hu());L(N,"uniform",fn());L(N,"weibull",Ea());u1.exports=N});var p1=s(function(h5e,h1){"use strict";var Tt=require("@stdlib/utils/define-nonenumerable-read-only-property"),lv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),g1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ele=require("@stdlib/utils/constant-function"),Lle=require("@stdlib/utils/noop"),Rle=require("@stdlib/object/assign"),v1=require("@stdlib/assert/is-number").isPrimitive,f1=require("@stdlib/math/base/assert/is-nan"),Ple=require("@stdlib/assert/is-plain-object"),_le=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tle=require("@stdlib/assert/has-own-property"),d1=require("@stdlib/constants/float64/max"),l1=en().factory,c1=require("@stdlib/symbol/iterator"),pu=require("@stdlib/string/format");function m1(r,e,i){var t,n,a,u,o;if(!v1(r)||f1(r))throw new TypeError(pu("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!v1(e)||f1(e))throw new TypeError(pu("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(pu("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(arguments.length>2){if(!Ple(i))throw new TypeError(pu("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Rle({},i),Tle(t,"iter")){if(!_le(t.iter))throw new TypeError(pu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=d1;a=l1(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=l1(r,e),t={iter:d1,state:a.state};return o=0,n={},Tt(n,"next",g),Tt(n,"return",f),t&&t.prng?(Tt(n,"seed",null),Tt(n,"seedLength",null),g1(n,"state",Ele(null),Lle),Tt(n,"stateLength",null),Tt(n,"byteLength",null)):(lv(n,"seed",c),lv(n,"seedLength",h),g1(n,"state",l,v),lv(n,"stateLength",y),lv(n,"byteLength",d)),Tt(n,"PRNG",a.PRNG),c1&&Tt(n,c1,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return m1(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}h1.exports=m1});var q1=s(function(p5e,y1){"use strict";var jle=p1();y1.exports=jle});var L1=s(function(y5e,E1){"use strict";var jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),cv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),b1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Mle=require("@stdlib/utils/constant-function"),xle=require("@stdlib/utils/noop"),Gle=require("@stdlib/object/assign"),Ale=require("@stdlib/assert/is-probability").isPrimitive,Vle=require("@stdlib/assert/is-plain-object"),Fle=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Wle=require("@stdlib/assert/has-own-property"),w1=require("@stdlib/constants/float64/max"),S1=Bs().factory,O1=require("@stdlib/symbol/iterator"),dm=require("@stdlib/string/format");function N1(r,e){var i,t,n,a,u;if(!Ale(r))throw new TypeError(dm("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!Vle(e))throw new TypeError(dm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=Gle({},e),Wle(i,"iter")){if(!Fle(i.iter))throw new TypeError(dm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=w1;n=S1(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=S1(r),i={iter:w1,state:n.state};return u=0,t={},jt(t,"next",o),jt(t,"return",g),i&&i.prng?(jt(t,"seed",null),jt(t,"seedLength",null),b1(t,"state",Mle(null),xle),jt(t,"stateLength",null),jt(t,"byteLength",null)):(cv(t,"seed",m),cv(t,"seedLength",c),b1(t,"state",d,l),cv(t,"stateLength",h),cv(t,"byteLength",y)),jt(t,"PRNG",n.PRNG),O1&&jt(t,O1,f),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function f(){return N1(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function h(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function d(){return n.PRNG.state}function l(v){n.PRNG.state=v}}E1.exports=N1});var P1=s(function(q5e,R1){"use strict";var Ile=L1();R1.exports=Ile});var V1=s(function(b5e,A1){"use strict";var Mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),mv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zle=require("@stdlib/utils/constant-function"),kle=require("@stdlib/utils/noop"),Jle=require("@stdlib/object/assign"),T1=require("@stdlib/assert/is-positive-number").isPrimitive,Ule=require("@stdlib/assert/is-plain-object"),Cle=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ble=require("@stdlib/assert/has-own-property"),j1=require("@stdlib/constants/float64/max"),M1=tn().factory,x1=require("@stdlib/symbol/iterator"),hv=require("@stdlib/string/format");function G1(r,e,i){var t,n,a,u,o;if(!T1(r))throw new TypeError(hv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!T1(e))throw new TypeError(hv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Ule(i))throw new TypeError(hv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Jle({},i),Ble(t,"iter")){if(!Cle(t.iter))throw new TypeError(hv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=j1;a=M1(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=M1(r,e),t={iter:j1,state:a.state};return o=0,n={},Mt(n,"next",g),Mt(n,"return",f),t&&t.prng?(Mt(n,"seed",null),Mt(n,"seedLength",null),_1(n,"state",zle(null),kle),Mt(n,"stateLength",null),Mt(n,"byteLength",null)):(mv(n,"seed",c),mv(n,"seedLength",h),_1(n,"state",l,v),mv(n,"stateLength",y),mv(n,"byteLength",d)),Mt(n,"PRNG",a.PRNG),x1&&Mt(n,x1,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return G1(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}A1.exports=G1});var W1=s(function(w5e,F1){"use strict";var Xle=V1();F1.exports=Xle});var X1=s(function(S5e,B1){"use strict";var xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),pv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),I1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Dle=require("@stdlib/utils/constant-function"),Yle=require("@stdlib/utils/noop"),Hle=require("@stdlib/object/assign"),z1=require("@stdlib/assert/is-positive-number").isPrimitive,Zle=require("@stdlib/assert/is-plain-object"),Qle=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$le=require("@stdlib/assert/has-own-property"),k1=require("@stdlib/constants/float64/max"),J1=nn().factory,U1=require("@stdlib/symbol/iterator"),yv=require("@stdlib/string/format");function C1(r,e,i){var t,n,a,u,o;if(!z1(r))throw new TypeError(yv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!z1(e))throw new TypeError(yv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Zle(i))throw new TypeError(yv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Hle({},i),$le(t,"iter")){if(!Qle(t.iter))throw new TypeError(yv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=k1;a=J1(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=J1(r,e),t={iter:k1,state:a.state};return o=0,n={},xt(n,"next",g),xt(n,"return",f),t&&t.prng?(xt(n,"seed",null),xt(n,"seedLength",null),I1(n,"state",Dle(null),Yle),xt(n,"stateLength",null),xt(n,"byteLength",null)):(pv(n,"seed",c),pv(n,"seedLength",h),I1(n,"state",l,v),pv(n,"stateLength",y),pv(n,"byteLength",d)),xt(n,"PRNG",a.PRNG),U1&&xt(n,U1,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return C1(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}B1.exports=C1});var Y1=s(function(O5e,D1){"use strict";var Kle=X1();D1.exports=Kle});var rx=s(function(N5e,ex){"use strict";var Gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),qv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),H1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ece=require("@stdlib/utils/constant-function"),rce=require("@stdlib/utils/noop"),tce=require("@stdlib/object/assign"),ice=require("@stdlib/assert/is-probability").isPrimitive,nce=require("@stdlib/assert/is-plain-object"),ace=require("@stdlib/assert/is-positive-integer").isPrimitive,sce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,uce=require("@stdlib/assert/has-own-property"),Z1=require("@stdlib/constants/float64/max"),Q1=Xs().factory,$1=require("@stdlib/symbol/iterator"),bv=require("@stdlib/string/format");function K1(r,e,i){var t,n,a,u,o;if(!ace(r))throw new TypeError(bv("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!ice(e))throw new TypeError(bv("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!nce(i))throw new TypeError(bv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=tce({},i),uce(t,"iter")){if(!sce(t.iter))throw new TypeError(bv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=Z1;a=Q1(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=Q1(r,e),t={iter:Z1,state:a.state};return o=0,n={},Gt(n,"next",g),Gt(n,"return",f),t&&t.prng?(Gt(n,"seed",null),Gt(n,"seedLength",null),H1(n,"state",ece(null),rce),Gt(n,"stateLength",null),Gt(n,"byteLength",null)):(qv(n,"seed",c),qv(n,"seedLength",h),H1(n,"state",l,v),qv(n,"stateLength",y),qv(n,"byteLength",d)),Gt(n,"PRNG",a.PRNG),$1&&Gt(n,$1,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return K1(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}ex.exports=K1});var ix=s(function(E5e,tx){"use strict";var oce=rx();tx.exports=oce});var fx=s(function(L5e,vx){"use strict";var At=require("@stdlib/utils/define-nonenumerable-read-only-property"),wv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),nx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gce=require("@stdlib/utils/constant-function"),vce=require("@stdlib/utils/noop"),fce=require("@stdlib/object/assign"),dce=require("@stdlib/assert/is-plain-object"),lce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,cce=require("@stdlib/assert/has-own-property"),ax=require("@stdlib/constants/float64/max"),sx=ca().factory,ux=require("@stdlib/symbol/iterator"),ox=require("@stdlib/string/format");function gx(r){var e,i,t,n,a;if(arguments.length>0){if(!dce(r))throw new TypeError(ox("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=fce({},r),cce(e,"iter")){if(!lce(e.iter))throw new TypeError(ox("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=ax;t=sx(e),e.prng===void 0&&e.copy!==!1&&(e.state=t.state)}else t=sx(),e={iter:ax,state:t.state};return a=0,i={},At(i,"next",u),At(i,"return",o),e&&e.prng?(At(i,"seed",null),At(i,"seedLength",null),nx(i,"state",gce(null),vce),At(i,"stateLength",null),At(i,"byteLength",null)):(wv(i,"seed",f),wv(i,"seedLength",m),nx(i,"state",y,d),wv(i,"stateLength",c),wv(i,"byteLength",h)),At(i,"PRNG",t.PRNG),ux&&At(i,ux,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return gx(e)}function f(){return t.PRNG.seed}function m(){return t.PRNG.seedLength}function c(){return t.PRNG.stateLength}function h(){return t.PRNG.byteLength}function y(){return t.PRNG.state}function d(l){t.PRNG.state=l}}vx.exports=gx});var lx=s(function(R5e,dx){"use strict";var mce=fx();dx.exports=mce});var bx=s(function(P5e,qx){"use strict";var Vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),hce=require("@stdlib/utils/constant-function"),pce=require("@stdlib/utils/noop"),yce=require("@stdlib/object/assign"),qce=require("@stdlib/assert/is-number").isPrimitive,bce=require("@stdlib/math/base/assert/is-nan"),wce=require("@stdlib/assert/is-plain-object"),Sce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Oce=require("@stdlib/assert/is-positive-number").isPrimitive,Nce=require("@stdlib/assert/has-own-property"),mx=require("@stdlib/constants/float64/max"),hx=Hs().factory,px=require("@stdlib/symbol/iterator"),Ov=require("@stdlib/string/format");function yx(r,e,i){var t,n,a,u,o;if(!qce(r)||bce(r))throw new TypeError(Ov("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Oce(e))throw new TypeError(Ov("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!wce(i))throw new TypeError(Ov("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=yce({},i),Nce(t,"iter")){if(!Sce(t.iter))throw new TypeError(Ov("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=mx;a=hx(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=hx(r,e),t={iter:mx,state:a.state};return o=0,n={},Vt(n,"next",g),Vt(n,"return",f),t&&t.prng?(Vt(n,"seed",null),Vt(n,"seedLength",null),cx(n,"state",hce(null),pce),Vt(n,"stateLength",null),Vt(n,"byteLength",null)):(Sv(n,"seed",c),Sv(n,"seedLength",h),cx(n,"state",l,v),Sv(n,"stateLength",y),Sv(n,"byteLength",d)),Vt(n,"PRNG",a.PRNG),px&&Vt(n,px,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return yx(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}qx.exports=yx});var Sx=s(function(_5e,wx){"use strict";var Ece=bx();wx.exports=Ece});var _x=s(function(T5e,Px){"use strict";var Ft=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ox=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lce=require("@stdlib/utils/constant-function"),Rce=require("@stdlib/utils/noop"),Pce=require("@stdlib/object/assign"),_ce=require("@stdlib/assert/is-positive-number").isPrimitive,Tce=require("@stdlib/assert/is-plain-object"),jce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mce=require("@stdlib/assert/has-own-property"),Nx=require("@stdlib/constants/float64/max"),Ex=Zs().factory,Lx=require("@stdlib/symbol/iterator"),lm=require("@stdlib/string/format");function Rx(r,e){var i,t,n,a,u;if(!_ce(r))throw new TypeError(lm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Tce(e))throw new TypeError(lm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=Pce({},e),Mce(i,"iter")){if(!jce(i.iter))throw new TypeError(lm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=Nx;n=Ex(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=Ex(r),i={iter:Nx,state:n.state};return u=0,t={},Ft(t,"next",o),Ft(t,"return",g),i&&i.prng?(Ft(t,"seed",null),Ft(t,"seedLength",null),Ox(t,"state",Lce(null),Rce),Ft(t,"stateLength",null),Ft(t,"byteLength",null)):(Nv(t,"seed",m),Nv(t,"seedLength",c),Ox(t,"state",d,l),Nv(t,"stateLength",h),Nv(t,"byteLength",y)),Ft(t,"PRNG",n.PRNG),Lx&&Ft(t,Lx,f),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function f(){return Rx(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function h(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function d(){return n.PRNG.state}function l(v){n.PRNG.state=v}}Px.exports=Rx});var jx=s(function(j5e,Tx){"use strict";var xce=_x();Tx.exports=xce});var Wx=s(function(M5e,Fx){"use strict";var Wt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ev=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Mx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Gce=require("@stdlib/utils/constant-function"),Ace=require("@stdlib/utils/noop"),Vce=require("@stdlib/object/assign"),Fce=require("@stdlib/assert/is-positive-number").isPrimitive,Wce=require("@stdlib/assert/is-plain-object"),Ice=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zce=require("@stdlib/assert/has-own-property"),xx=require("@stdlib/constants/float64/max"),Gx=Ot().factory,Ax=require("@stdlib/symbol/iterator"),cm=require("@stdlib/string/format");function Vx(r,e){var i,t,n,a,u;if(!Fce(r))throw new TypeError(cm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Wce(e))throw new TypeError(cm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=Vce({},e),zce(i,"iter")){if(!Ice(i.iter))throw new TypeError(cm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=xx;n=Gx(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=Gx(r),i={iter:xx,state:n.state};return u=0,t={},Wt(t,"next",o),Wt(t,"return",g),i&&i.prng?(Wt(t,"seed",null),Wt(t,"seedLength",null),Mx(t,"state",Gce(null),Ace),Wt(t,"stateLength",null),Wt(t,"byteLength",null)):(Ev(t,"seed",m),Ev(t,"seedLength",c),Mx(t,"state",d,l),Ev(t,"stateLength",h),Ev(t,"byteLength",y)),Wt(t,"PRNG",n.PRNG),Ax&&Wt(t,Ax,f),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function f(){return Vx(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function h(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function d(){return n.PRNG.state}function l(v){n.PRNG.state=v}}Fx.exports=Vx});var zx=s(function(x5e,Ix){"use strict";var kce=Wx();Ix.exports=kce});var Dx=s(function(G5e,Xx){"use strict";var It=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Jce=require("@stdlib/utils/constant-function"),Uce=require("@stdlib/utils/noop"),Cce=require("@stdlib/object/assign"),Bce=require("@stdlib/assert/is-number").isPrimitive,Xce=require("@stdlib/math/base/assert/is-nan"),Dce=require("@stdlib/assert/is-plain-object"),Yce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Hce=require("@stdlib/assert/is-positive-number").isPrimitive,Zce=require("@stdlib/assert/has-own-property"),Jx=require("@stdlib/constants/float64/max"),Ux=an().factory,Cx=require("@stdlib/symbol/iterator"),Rv=require("@stdlib/string/format");function Bx(r,e,i){var t,n,a,u,o;if(!Bce(r)||Xce(r))throw new TypeError(Rv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Hce(e))throw new TypeError(Rv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Dce(i))throw new TypeError(Rv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Cce({},i),Zce(t,"iter")){if(!Yce(t.iter))throw new TypeError(Rv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=Jx;a=Ux(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=Ux(r,e),t={iter:Jx,state:a.state};return o=0,n={},It(n,"next",g),It(n,"return",f),t&&t.prng?(It(n,"seed",null),It(n,"seedLength",null),kx(n,"state",Jce(null),Uce),It(n,"stateLength",null),It(n,"byteLength",null)):(Lv(n,"seed",c),Lv(n,"seedLength",h),kx(n,"state",l,v),Lv(n,"stateLength",y),Lv(n,"byteLength",d)),It(n,"PRNG",a.PRNG),Cx&&It(n,Cx,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return Bx(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}Xx.exports=Bx});var Hx=s(function(A5e,Yx){"use strict";var Qce=Dx();Yx.exports=Qce});var iG=s(function(V5e,tG){"use strict";var zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Zx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$ce=require("@stdlib/utils/constant-function"),Kce=require("@stdlib/utils/noop"),eme=require("@stdlib/object/assign"),Qx=require("@stdlib/assert/is-number").isPrimitive,rme=require("@stdlib/assert/is-plain-object"),tme=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ime=require("@stdlib/assert/has-own-property"),$x=require("@stdlib/constants/float64/max"),Kx=sn().factory,eG=require("@stdlib/symbol/iterator"),yu=require("@stdlib/string/format");function rG(r,e,i){var t,n,a,u,o;if(!Qx(r))throw new TypeError(yu("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!Qx(e))throw new TypeError(yu("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(yu("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d,%d]`.",r,e));if(arguments.length>2){if(!rme(i))throw new TypeError(yu("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=eme({},i),ime(t,"iter")){if(!tme(t.iter))throw new TypeError(yu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=$x;a=Kx(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=Kx(r,e),t={iter:$x,state:a.state};return o=0,n={},zt(n,"next",g),zt(n,"return",f),t&&t.prng?(zt(n,"seed",null),zt(n,"seedLength",null),Zx(n,"state",$ce(null),Kce),zt(n,"stateLength",null),zt(n,"byteLength",null)):(Pv(n,"seed",c),Pv(n,"seedLength",h),Zx(n,"state",l,v),Pv(n,"stateLength",y),Pv(n,"byteLength",d)),zt(n,"PRNG",a.PRNG),eG&&zt(n,eG,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return rG(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}tG.exports=rG});var aG=s(function(F5e,nG){"use strict";var nme=iG();nG.exports=nme});var dG=s(function(W5e,fG){"use strict";var kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),_v=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ame=require("@stdlib/utils/constant-function"),sme=require("@stdlib/utils/noop"),ume=require("@stdlib/object/assign"),ome=require("@stdlib/assert/is-positive-number").isPrimitive,gme=require("@stdlib/assert/is-plain-object"),vme=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,fme=require("@stdlib/assert/is-positive-integer").isPrimitive,dme=require("@stdlib/assert/has-own-property"),uG=require("@stdlib/constants/float64/max"),oG=Qs().factory,gG=require("@stdlib/symbol/iterator"),Tv=require("@stdlib/string/format");function vG(r,e,i){var t,n,a,u,o;if(!fme(r))throw new TypeError(Tv("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!ome(e))throw new TypeError(Tv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!gme(i))throw new TypeError(Tv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=ume({},i),dme(t,"iter")){if(!vme(t.iter))throw new TypeError(Tv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=uG;a=oG(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=oG(r,e),t={iter:uG,state:a.state};return o=0,n={},kt(n,"next",g),kt(n,"return",f),t&&t.prng?(kt(n,"seed",null),kt(n,"seedLength",null),sG(n,"state",ame(null),sme),kt(n,"stateLength",null),kt(n,"byteLength",null)):(_v(n,"seed",c),_v(n,"seedLength",h),sG(n,"state",l,v),_v(n,"stateLength",y),_v(n,"byteLength",d)),kt(n,"PRNG",a.PRNG),gG&&kt(n,gG,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return vG(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}fG.exports=vG});var cG=s(function(I5e,lG){"use strict";var lme=dG();lG.exports=lme});var wG=s(function(z5e,bG){"use strict";var Jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),jv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),mG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cme=require("@stdlib/utils/constant-function"),mme=require("@stdlib/utils/noop"),hme=require("@stdlib/object/assign"),pme=require("@stdlib/assert/is-positive-number").isPrimitive,yme=require("@stdlib/assert/is-plain-object"),qme=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bme=require("@stdlib/assert/has-own-property"),hG=require("@stdlib/constants/float64/max"),pG=un().factory,yG=require("@stdlib/symbol/iterator"),mm=require("@stdlib/string/format");function qG(r,e){var i,t,n,a,u;if(!pme(r))throw new TypeError(mm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!yme(e))throw new TypeError(mm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=hme({},e),bme(i,"iter")){if(!qme(i.iter))throw new TypeError(mm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=hG;n=pG(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=pG(r),i={iter:hG,state:n.state};return u=0,t={},Jt(t,"next",o),Jt(t,"return",g),i&&i.prng?(Jt(t,"seed",null),Jt(t,"seedLength",null),mG(t,"state",cme(null),mme),Jt(t,"stateLength",null),Jt(t,"byteLength",null)):(jv(t,"seed",m),jv(t,"seedLength",c),mG(t,"state",d,l),jv(t,"stateLength",h),jv(t,"byteLength",y)),Jt(t,"PRNG",n.PRNG),yG&&Jt(t,yG,f),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function f(){return qG(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function h(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function d(){return n.PRNG.state}function l(v){n.PRNG.state=v}}bG.exports=qG});var OG=s(function(k5e,SG){"use strict";var wme=wG();SG.exports=wme});var jG=s(function(J5e,TG){"use strict";var Ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Sme=require("@stdlib/utils/constant-function"),Ome=require("@stdlib/utils/noop"),Nme=require("@stdlib/object/assign"),EG=require("@stdlib/assert/is-positive-number").isPrimitive,Eme=require("@stdlib/assert/is-plain-object"),Lme=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rme=require("@stdlib/assert/has-own-property"),LG=require("@stdlib/constants/float64/max"),RG=$s().factory,PG=require("@stdlib/symbol/iterator"),xv=require("@stdlib/string/format");function _G(r,e,i){var t,n,a,u,o;if(!EG(r))throw new TypeError(xv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!EG(e))throw new TypeError(xv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Eme(i))throw new TypeError(xv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Nme({},i),Rme(t,"iter")){if(!Lme(t.iter))throw new TypeError(xv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=LG;a=RG(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=RG(r,e),t={iter:LG,state:a.state};return o=0,n={},Ut(n,"next",g),Ut(n,"return",f),t&&t.prng?(Ut(n,"seed",null),Ut(n,"seedLength",null),NG(n,"state",Sme(null),Ome),Ut(n,"stateLength",null),Ut(n,"byteLength",null)):(Mv(n,"seed",c),Mv(n,"seedLength",h),NG(n,"state",l,v),Mv(n,"stateLength",y),Mv(n,"byteLength",d)),Ut(n,"PRNG",a.PRNG),PG&&Ut(n,PG,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return _G(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}TG.exports=_G});var xG=s(function(U5e,MG){"use strict";var Pme=jG();MG.exports=Pme});var kG=s(function(C5e,zG){"use strict";var Ct=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),GG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),_me=require("@stdlib/utils/constant-function"),Tme=require("@stdlib/utils/noop"),jme=require("@stdlib/object/assign"),AG=require("@stdlib/assert/is-positive-number").isPrimitive,Mme=require("@stdlib/assert/is-plain-object"),xme=require("@stdlib/assert/is-number").isPrimitive,Gme=require("@stdlib/math/base/assert/is-nan"),Ame=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vme=require("@stdlib/assert/has-own-property"),VG=require("@stdlib/constants/float64/max"),FG=Ks().factory,WG=require("@stdlib/symbol/iterator"),qu=require("@stdlib/string/format");function IG(r,e,i,t){var n,a,u,o,g;if(!AG(r))throw new TypeError(qu("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!AG(e))throw new TypeError(qu("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(!xme(i)||Gme(i))throw new TypeError(qu("invalid argument. Third argument must be a number. Value: `%s`.",i));if(arguments.length>3){if(!Mme(t))throw new TypeError(qu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(n=jme({},t),Vme(n,"iter")){if(!Ame(n.iter))throw new TypeError(qu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=VG;u=FG(r,e,i,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=FG(r,e,i),n={iter:VG,state:u.state};return g=0,a={},Ct(a,"next",f),Ct(a,"return",m),n&&n.prng?(Ct(a,"seed",null),Ct(a,"seedLength",null),GG(a,"state",_me(null),Tme),Ct(a,"stateLength",null),Ct(a,"byteLength",null)):(Gv(a,"seed",h),Gv(a,"seedLength",y),GG(a,"state",v,p),Gv(a,"stateLength",d),Gv(a,"byteLength",l)),Ct(a,"PRNG",u.PRNG),WG&&Ct(a,WG,c),a;function f(){return g+=1,o||g>n.iter?{done:!0}:{value:u(),done:!1}}function m(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function c(){return IG(r,e,i,n)}function h(){return u.PRNG.seed}function y(){return u.PRNG.seedLength}function d(){return u.PRNG.stateLength}function l(){return u.PRNG.byteLength}function v(){return u.PRNG.state}function p(q){u.PRNG.state=q}}zG.exports=IG});var UG=s(function(B5e,JG){"use strict";var Fme=kG();JG.exports=Fme});var QG=s(function(X5e,ZG){"use strict";var Bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Av=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),CG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Wme=require("@stdlib/utils/constant-function"),Ime=require("@stdlib/utils/noop"),zme=require("@stdlib/object/assign"),BG=require("@stdlib/assert/is-positive-number").isPrimitive,kme=require("@stdlib/assert/is-plain-object"),Jme=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ume=require("@stdlib/assert/has-own-property"),XG=require("@stdlib/constants/float64/max"),DG=ke().factory,YG=require("@stdlib/symbol/iterator"),Vv=require("@stdlib/string/format");function HG(r,e,i){var t,n,a,u,o;if(!BG(r))throw new TypeError(Vv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!BG(e))throw new TypeError(Vv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!kme(i))throw new TypeError(Vv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=zme({},i),Ume(t,"iter")){if(!Jme(t.iter))throw new TypeError(Vv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=XG;a=DG(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=DG(r,e),t={iter:XG,state:a.state};return o=0,n={},Bt(n,"next",g),Bt(n,"return",f),t&&t.prng?(Bt(n,"seed",null),Bt(n,"seedLength",null),CG(n,"state",Wme(null),Ime),Bt(n,"stateLength",null),Bt(n,"byteLength",null)):(Av(n,"seed",c),Av(n,"seedLength",h),CG(n,"state",l,v),Av(n,"stateLength",y),Av(n,"byteLength",d)),Bt(n,"PRNG",a.PRNG),YG&&Bt(n,YG,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return HG(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}ZG.exports=HG});var KG=s(function(D5e,$G){"use strict";var Cme=QG();$G.exports=Cme});var sA=s(function(Y5e,aA){"use strict";var Xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),eA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Bme=require("@stdlib/utils/constant-function"),Xme=require("@stdlib/utils/noop"),Dme=require("@stdlib/object/assign"),Yme=require("@stdlib/assert/is-probability").isPrimitive,Hme=require("@stdlib/assert/is-plain-object"),Zme=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qme=require("@stdlib/assert/has-own-property"),rA=require("@stdlib/constants/float64/max"),tA=ua().factory,iA=require("@stdlib/symbol/iterator"),hm=require("@stdlib/string/format");function nA(r,e){var i,t,n,a,u;if(!Yme(r))throw new TypeError(hm("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!Hme(e))throw new TypeError(hm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=Dme({},e),Qme(i,"iter")){if(!Zme(i.iter))throw new TypeError(hm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=rA;n=tA(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=tA(r),i={iter:rA,state:n.state};return u=0,t={},Xt(t,"next",o),Xt(t,"return",g),i&&i.prng?(Xt(t,"seed",null),Xt(t,"seedLength",null),eA(t,"state",Bme(null),Xme),Xt(t,"stateLength",null),Xt(t,"byteLength",null)):(Fv(t,"seed",m),Fv(t,"seedLength",c),eA(t,"state",d,l),Fv(t,"stateLength",h),Fv(t,"byteLength",y)),Xt(t,"PRNG",n.PRNG),iA&&Xt(t,iA,f),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function f(){return nA(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function h(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function d(){return n.PRNG.state}function l(v){n.PRNG.state=v}}aA.exports=nA});var oA=s(function(H5e,uA){"use strict";var $me=sA();uA.exports=$me});var mA=s(function(Z5e,cA){"use strict";var Dt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),gA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Kme=require("@stdlib/utils/constant-function"),ehe=require("@stdlib/utils/noop"),rhe=require("@stdlib/object/assign"),the=require("@stdlib/assert/is-number").isPrimitive,ihe=require("@stdlib/math/base/assert/is-nan"),nhe=require("@stdlib/assert/is-plain-object"),ahe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,she=require("@stdlib/assert/is-positive-number").isPrimitive,uhe=require("@stdlib/assert/has-own-property"),vA=require("@stdlib/constants/float64/max"),fA=eu().factory,dA=require("@stdlib/symbol/iterator"),Iv=require("@stdlib/string/format");function lA(r,e,i){var t,n,a,u,o;if(!the(r)||ihe(r))throw new TypeError(Iv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!she(e))throw new TypeError(Iv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!nhe(i))throw new TypeError(Iv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=rhe({},i),uhe(t,"iter")){if(!ahe(t.iter))throw new TypeError(Iv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=vA;a=fA(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=fA(r,e),t={iter:vA,state:a.state};return o=0,n={},Dt(n,"next",g),Dt(n,"return",f),t&&t.prng?(Dt(n,"seed",null),Dt(n,"seedLength",null),gA(n,"state",Kme(null),ehe),Dt(n,"stateLength",null),Dt(n,"byteLength",null)):(Wv(n,"seed",c),Wv(n,"seedLength",h),gA(n,"state",l,v),Wv(n,"stateLength",y),Wv(n,"byteLength",d)),Dt(n,"PRNG",a.PRNG),dA&&Dt(n,dA,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return lA(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}cA.exports=lA});var pA=s(function(Q5e,hA){"use strict";var ohe=mA();hA.exports=ohe});var NA=s(function($5e,OA){"use strict";var Yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),zv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ghe=require("@stdlib/utils/constant-function"),vhe=require("@stdlib/utils/noop"),fhe=require("@stdlib/object/assign"),dhe=require("@stdlib/assert/is-plain-object"),kv=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,lhe=require("@stdlib/assert/has-own-property"),qA=require("@stdlib/constants/float64/max"),bA=tu().factory,wA=require("@stdlib/symbol/iterator"),dn=require("@stdlib/string/format");function SA(r,e,i,t){var n,a,u,o,g;if(!kv(r))throw new TypeError(dn("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!kv(e))throw new TypeError(dn("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!kv(i))throw new TypeError(dn("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",i));if(i>r)throw new RangeError(dn("invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.",i));if(e>r)throw new RangeError(dn("invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.",e));if(arguments.length>3){if(!dhe(t))throw new TypeError(dn("invalid argument. Options argument must be an object. Value: `%s`.",t));if(n=fhe({},t),lhe(n,"iter")){if(!kv(n.iter))throw new TypeError(dn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=qA;u=bA(r,e,i,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=bA(r,e,i),n={iter:qA,state:u.state};return g=0,a={},Yt(a,"next",f),Yt(a,"return",m),n&&n.prng?(Yt(a,"seed",null),Yt(a,"seedLength",null),yA(a,"state",ghe(null),vhe),Yt(a,"stateLength",null),Yt(a,"byteLength",null)):(zv(a,"seed",h),zv(a,"seedLength",y),yA(a,"state",v,p),zv(a,"stateLength",d),zv(a,"byteLength",l)),Yt(a,"PRNG",u.PRNG),wA&&Yt(a,wA,c),a;function f(){return g+=1,o||g>n.iter?{done:!0}:{value:u(),done:!1}}function m(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function c(){return SA(r,e,i,n)}function h(){return u.PRNG.seed}function y(){return u.PRNG.seedLength}function d(){return u.PRNG.stateLength}function l(){return u.PRNG.byteLength}function v(){return u.PRNG.state}function p(q){u.PRNG.state=q}}OA.exports=SA});var LA=s(function(K5e,EA){"use strict";var che=NA();EA.exports=che});var GA=s(function(e6e,xA){"use strict";var Ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),mhe=require("@stdlib/utils/constant-function"),hhe=require("@stdlib/utils/noop"),phe=require("@stdlib/object/assign"),yhe=require("@stdlib/assert/is-plain-object"),qhe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bhe=require("@stdlib/assert/has-own-property"),PA=require("@stdlib/constants/float64/max"),_A=H().factory,TA=require("@stdlib/symbol/iterator"),jA=require("@stdlib/string/format");function MA(r){var e,i,t,n,a;if(arguments.length>0){if(!yhe(r))throw new TypeError(jA("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=phe({},r),bhe(e,"iter")){if(!qhe(e.iter))throw new TypeError(jA("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=PA;t=_A(e),e.prng===void 0&&e.copy!==!1&&(e.state=t.state)}else t=_A(),e={iter:PA,state:t.state};return a=0,i={},Ht(i,"next",u),Ht(i,"return",o),e&&e.prng?(Ht(i,"seed",null),Ht(i,"seedLength",null),RA(i,"state",mhe(null),hhe),Ht(i,"stateLength",null),Ht(i,"byteLength",null)):(Jv(i,"seed",f),Jv(i,"seedLength",m),RA(i,"state",y,d),Jv(i,"stateLength",c),Jv(i,"byteLength",h)),Ht(i,"PRNG",t.PRNG),TA&&Ht(i,TA,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return MA(e)}function f(){return t.PRNG.seed}function m(){return t.PRNG.seedLength}function c(){return t.PRNG.stateLength}function h(){return t.PRNG.byteLength}function y(){return t.PRNG.state}function d(l){t.PRNG.state=l}}xA.exports=MA});var VA=s(function(r6e,AA){"use strict";var whe=GA();AA.exports=whe});var CA=s(function(t6e,UA){"use strict";var Zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),FA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),She=require("@stdlib/utils/constant-function"),Ohe=require("@stdlib/utils/noop"),Nhe=require("@stdlib/object/assign"),WA=require("@stdlib/assert/is-positive-number").isPrimitive,Ehe=require("@stdlib/assert/is-plain-object"),Lhe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rhe=require("@stdlib/assert/has-own-property"),IA=require("@stdlib/constants/float64/max"),zA=on().factory,kA=require("@stdlib/symbol/iterator"),Cv=require("@stdlib/string/format");function JA(r,e,i){var t,n,a,u,o;if(!WA(r))throw new TypeError(Cv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!WA(e))throw new TypeError(Cv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Ehe(i))throw new TypeError(Cv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Nhe({},i),Rhe(t,"iter")){if(!Lhe(t.iter))throw new TypeError(Cv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=IA;a=zA(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=zA(r,e),t={iter:IA,state:a.state};return o=0,n={},Zt(n,"next",g),Zt(n,"return",f),t&&t.prng?(Zt(n,"seed",null),Zt(n,"seedLength",null),FA(n,"state",She(null),Ohe),Zt(n,"stateLength",null),Zt(n,"byteLength",null)):(Uv(n,"seed",c),Uv(n,"seedLength",h),FA(n,"state",l,v),Uv(n,"stateLength",y),Uv(n,"byteLength",d)),Zt(n,"PRNG",a.PRNG),kA&&Zt(n,kA,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return JA(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}UA.exports=JA});var XA=s(function(i6e,BA){"use strict";var Phe=CA();BA.exports=Phe});var eV=s(function(n6e,KA){"use strict";var Qt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),DA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),_he=require("@stdlib/utils/constant-function"),The=require("@stdlib/utils/noop"),jhe=require("@stdlib/object/assign"),YA=require("@stdlib/assert/is-positive-number").isPrimitive,Mhe=require("@stdlib/assert/is-plain-object"),xhe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ghe=require("@stdlib/assert/has-own-property"),HA=require("@stdlib/constants/float64/max"),ZA=iu().factory,QA=require("@stdlib/symbol/iterator"),Xv=require("@stdlib/string/format");function $A(r,e,i){var t,n,a,u,o;if(!YA(r))throw new TypeError(Xv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!YA(e))throw new TypeError(Xv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Mhe(i))throw new TypeError(Xv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=jhe({},i),Ghe(t,"iter")){if(!xhe(t.iter))throw new TypeError(Xv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=HA;a=ZA(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=ZA(r,e),t={iter:HA,state:a.state};return o=0,n={},Qt(n,"next",g),Qt(n,"return",f),t&&t.prng?(Qt(n,"seed",null),Qt(n,"seedLength",null),DA(n,"state",_he(null),The),Qt(n,"stateLength",null),Qt(n,"byteLength",null)):(Bv(n,"seed",c),Bv(n,"seedLength",h),DA(n,"state",l,v),Bv(n,"stateLength",y),Bv(n,"byteLength",d)),Qt(n,"PRNG",a.PRNG),QA&&Qt(n,QA,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return $A(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}KA.exports=$A});var tV=s(function(a6e,rV){"use strict";var Ahe=eV();rV.exports=Ahe});var gV=s(function(s6e,oV){"use strict";var $t=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),iV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Vhe=require("@stdlib/utils/constant-function"),Fhe=require("@stdlib/utils/noop"),Whe=require("@stdlib/object/assign"),Ihe=require("@stdlib/assert/is-number").isPrimitive,zhe=require("@stdlib/math/base/assert/is-nan"),khe=require("@stdlib/assert/is-plain-object"),Jhe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Uhe=require("@stdlib/assert/is-positive-number").isPrimitive,Che=require("@stdlib/assert/has-own-property"),nV=require("@stdlib/constants/float64/max"),aV=nu().factory,sV=require("@stdlib/symbol/iterator"),Yv=require("@stdlib/string/format");function uV(r,e,i){var t,n,a,u,o;if(!Ihe(r)||zhe(r))throw new TypeError(Yv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Uhe(e))throw new TypeError(Yv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!khe(i))throw new TypeError(Yv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Whe({},i),Che(t,"iter")){if(!Jhe(t.iter))throw new TypeError(Yv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=nV;a=aV(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=aV(r,e),t={iter:nV,state:a.state};return o=0,n={},$t(n,"next",g),$t(n,"return",f),t&&t.prng?($t(n,"seed",null),$t(n,"seedLength",null),iV(n,"state",Vhe(null),Fhe),$t(n,"stateLength",null),$t(n,"byteLength",null)):(Dv(n,"seed",c),Dv(n,"seedLength",h),iV(n,"state",l,v),Dv(n,"stateLength",y),Dv(n,"byteLength",d)),$t(n,"PRNG",a.PRNG),sV&&$t(n,sV,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return uV(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}oV.exports=uV});var fV=s(function(u6e,vV){"use strict";var Bhe=gV();vV.exports=Bhe});var yV=s(function(o6e,pV){"use strict";var Kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),dV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Xhe=require("@stdlib/utils/constant-function"),Dhe=require("@stdlib/utils/noop"),Yhe=require("@stdlib/object/assign"),Hhe=require("@stdlib/assert/is-number").isPrimitive,Zhe=require("@stdlib/math/base/assert/is-nan"),Qhe=require("@stdlib/assert/is-plain-object"),$he=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Khe=require("@stdlib/assert/is-positive-number").isPrimitive,epe=require("@stdlib/assert/has-own-property"),lV=require("@stdlib/constants/float64/max"),cV=au().factory,mV=require("@stdlib/symbol/iterator"),Zv=require("@stdlib/string/format");function hV(r,e,i){var t,n,a,u,o;if(!Hhe(r)||Zhe(r))throw new TypeError(Zv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Khe(e))throw new TypeError(Zv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Qhe(i))throw new TypeError(Zv("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Yhe({},i),epe(t,"iter")){if(!$he(t.iter))throw new TypeError(Zv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=lV;a=cV(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=cV(r,e),t={iter:lV,state:a.state};return o=0,n={},Kt(n,"next",g),Kt(n,"return",f),t&&t.prng?(Kt(n,"seed",null),Kt(n,"seedLength",null),dV(n,"state",Xhe(null),Dhe),Kt(n,"stateLength",null),Kt(n,"byteLength",null)):(Hv(n,"seed",c),Hv(n,"seedLength",h),dV(n,"state",l,v),Hv(n,"stateLength",y),Hv(n,"byteLength",d)),Kt(n,"PRNG",a.PRNG),mV&&Kt(n,mV,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return hV(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}pV.exports=hV});var bV=s(function(g6e,qV){"use strict";var rpe=yV();qV.exports=rpe});var RV=s(function(v6e,LV){"use strict";var ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),tpe=require("@stdlib/utils/constant-function"),ipe=require("@stdlib/utils/noop"),npe=require("@stdlib/object/assign"),ape=require("@stdlib/assert/is-number").isPrimitive,spe=require("@stdlib/math/base/assert/is-nan"),upe=require("@stdlib/assert/is-plain-object"),ope=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,gpe=require("@stdlib/assert/is-positive-number").isPrimitive,vpe=require("@stdlib/assert/has-own-property"),SV=require("@stdlib/constants/float64/max"),OV=su().factory,NV=require("@stdlib/symbol/iterator"),$v=require("@stdlib/string/format");function EV(r,e,i){var t,n,a,u,o;if(!ape(r)||spe(r))throw new TypeError($v("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!gpe(e))throw new TypeError($v("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!upe(i))throw new TypeError($v("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=npe({},i),vpe(t,"iter")){if(!ope(t.iter))throw new TypeError($v("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=SV;a=OV(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=OV(r,e),t={iter:SV,state:a.state};return o=0,n={},ei(n,"next",g),ei(n,"return",f),t&&t.prng?(ei(n,"seed",null),ei(n,"seedLength",null),wV(n,"state",tpe(null),ipe),ei(n,"stateLength",null),ei(n,"byteLength",null)):(Qv(n,"seed",c),Qv(n,"seedLength",h),wV(n,"state",l,v),Qv(n,"stateLength",y),Qv(n,"byteLength",d)),ei(n,"PRNG",a.PRNG),NV&&ei(n,NV,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return EV(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}LV.exports=EV});var _V=s(function(f6e,PV){"use strict";var fpe=RV();PV.exports=fpe});var VV=s(function(d6e,AV){"use strict";var ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),TV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dpe=require("@stdlib/utils/constant-function"),lpe=require("@stdlib/utils/noop"),cpe=require("@stdlib/object/assign"),mpe=require("@stdlib/assert/is-number").isPrimitive,hpe=require("@stdlib/math/base/assert/is-nan"),ppe=require("@stdlib/assert/is-plain-object"),ype=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qpe=require("@stdlib/assert/is-positive-number").isPrimitive,bpe=require("@stdlib/assert/has-own-property"),jV=require("@stdlib/constants/float64/max"),MV=gn().factory,xV=require("@stdlib/symbol/iterator"),ef=require("@stdlib/string/format");function GV(r,e,i){var t,n,a,u,o;if(!mpe(r)||hpe(r))throw new TypeError(ef("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!qpe(e))throw new TypeError(ef("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!ppe(i))throw new TypeError(ef("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=cpe({},i),bpe(t,"iter")){if(!ype(t.iter))throw new TypeError(ef("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=jV;a=MV(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=MV(r,e),t={iter:jV,state:a.state};return o=0,n={},ri(n,"next",g),ri(n,"return",f),t&&t.prng?(ri(n,"seed",null),ri(n,"seedLength",null),TV(n,"state",dpe(null),lpe),ri(n,"stateLength",null),ri(n,"byteLength",null)):(Kv(n,"seed",c),Kv(n,"seedLength",h),TV(n,"state",l,v),Kv(n,"stateLength",y),Kv(n,"byteLength",d)),ri(n,"PRNG",a.PRNG),xV&&ri(n,xV,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return GV(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}AV.exports=GV});var WV=s(function(l6e,FV){"use strict";var wpe=VV();FV.exports=wpe});var BV=s(function(c6e,CV){"use strict";var pm=require("@stdlib/utils/define-nonenumerable-read-only-property"),rf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Spe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ope=require("@stdlib/object/assign"),Npe=require("@stdlib/assert/is-plain-object"),Epe=require("@stdlib/assert/is-boolean").isPrimitive,Lpe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,IV=require("@stdlib/assert/has-own-property"),zV=require("@stdlib/constants/float64/max"),kV=Z().factory,JV=require("@stdlib/symbol/iterator"),ym=require("@stdlib/string/format");function UV(r){var e,i,t,n,a;if(arguments.length>0){if(!Npe(r))throw new TypeError(ym("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Ope({},r),IV(e,"normalized")&&!Epe(e.normalized))throw new TypeError(ym("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(IV(e,"iter")){if(!Lpe(e.iter))throw new TypeError(ym("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=zV;t=kV(e),e.copy!==!1&&(e.state=t.state)}else t=kV(),e={iter:zV,state:t.state};return e.normalized&&(t=t.normalized),a=0,i={},pm(i,"next",u),pm(i,"return",o),rf(i,"seed",f),rf(i,"seedLength",m),Spe(i,"state",y,d),rf(i,"stateLength",c),rf(i,"byteLength",h),JV&&pm(i,JV,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return UV(e)}function f(){return t.seed}function m(){return t.seedLength}function c(){return t.stateLength}function h(){return t.byteLength}function y(){return t.state}function d(l){t.state=l}}CV.exports=UV});var DV=s(function(m6e,XV){"use strict";var Rpe=BV();XV.exports=Rpe});var e2=s(function(h6e,KV){"use strict";var qm=require("@stdlib/utils/define-nonenumerable-read-only-property"),tf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ppe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),_pe=require("@stdlib/object/assign"),Tpe=require("@stdlib/assert/is-plain-object"),jpe=require("@stdlib/assert/is-boolean").isPrimitive,Mpe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,YV=require("@stdlib/assert/has-own-property"),HV=require("@stdlib/constants/float64/max"),ZV=$().factory,QV=require("@stdlib/symbol/iterator"),bm=require("@stdlib/string/format");function $V(r){var e,i,t,n,a;if(arguments.length>0){if(!Tpe(r))throw new TypeError(bm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=_pe({},r),YV(e,"normalized")&&!jpe(e.normalized))throw new TypeError(bm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(YV(e,"iter")){if(!Mpe(e.iter))throw new TypeError(bm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=HV;t=ZV(e),e.copy!==!1&&(e.state=t.state)}else t=ZV(),e={iter:HV,state:t.state};return e.normalized&&(t=t.normalized),a=0,i={},qm(i,"next",u),qm(i,"return",o),tf(i,"seed",f),tf(i,"seedLength",m),Ppe(i,"state",y,d),tf(i,"stateLength",c),tf(i,"byteLength",h),QV&&qm(i,QV,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return $V(e)}function f(){return t.seed}function m(){return t.seedLength}function c(){return t.stateLength}function h(){return t.byteLength}function y(){return t.state}function d(l){t.state=l}}KV.exports=$V});var t2=s(function(p6e,r2){"use strict";var xpe=e2();r2.exports=xpe});var g2=s(function(y6e,o2){"use strict";var wm=require("@stdlib/utils/define-nonenumerable-read-only-property"),nf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Gpe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ape=require("@stdlib/object/assign"),Vpe=require("@stdlib/assert/is-plain-object"),Fpe=require("@stdlib/assert/is-boolean").isPrimitive,Wpe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,i2=require("@stdlib/assert/has-own-property"),n2=require("@stdlib/constants/float64/max"),a2=j().factory,s2=require("@stdlib/symbol/iterator"),Sm=require("@stdlib/string/format");function u2(r){var e,i,t,n,a;if(arguments.length>0){if(!Vpe(r))throw new TypeError(Sm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Ape({},r),i2(e,"normalized")&&!Fpe(e.normalized))throw new TypeError(Sm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(i2(e,"iter")){if(!Wpe(e.iter))throw new TypeError(Sm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=n2;t=a2(e),e.copy!==!1&&(e.state=t.state)}else t=a2(),e={iter:n2,state:t.state};return e.normalized&&(t=t.normalized),a=0,i={},wm(i,"next",u),wm(i,"return",o),nf(i,"seed",f),nf(i,"seedLength",m),Gpe(i,"state",y,d),nf(i,"stateLength",c),nf(i,"byteLength",h),s2&&wm(i,s2,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return u2(e)}function f(){return t.seed}function m(){return t.seedLength}function c(){return t.stateLength}function h(){return t.byteLength}function y(){return t.state}function d(l){t.state=l}}o2.exports=u2});var f2=s(function(q6e,v2){"use strict";var Ipe=g2();v2.exports=Ipe});var y2=s(function(b6e,p2){"use strict";var ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),af=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),d2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zpe=require("@stdlib/utils/constant-function"),kpe=require("@stdlib/utils/noop"),Jpe=require("@stdlib/object/assign"),Upe=require("@stdlib/assert/is-probability").isPrimitive,Cpe=require("@stdlib/assert/is-plain-object"),Bpe=require("@stdlib/assert/is-positive-number").isPrimitive,Xpe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Dpe=require("@stdlib/assert/has-own-property"),l2=require("@stdlib/constants/float64/max"),c2=uu().factory,m2=require("@stdlib/symbol/iterator"),sf=require("@stdlib/string/format");function h2(r,e,i){var t,n,a,u,o;if(!Bpe(r))throw new TypeError(sf("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!Upe(e))throw new TypeError(sf("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!Cpe(i))throw new TypeError(sf("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Jpe({},i),Dpe(t,"iter")){if(!Xpe(t.iter))throw new TypeError(sf("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=l2;a=c2(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=c2(r,e),t={iter:l2,state:a.state};return o=0,n={},ti(n,"next",g),ti(n,"return",f),t&&t.prng?(ti(n,"seed",null),ti(n,"seedLength",null),d2(n,"state",zpe(null),kpe),ti(n,"stateLength",null),ti(n,"byteLength",null)):(af(n,"seed",c),af(n,"seedLength",h),d2(n,"state",l,v),af(n,"stateLength",y),af(n,"byteLength",d)),ti(n,"PRNG",a.PRNG),m2&&ti(n,m2,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return h2(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}p2.exports=h2});var b2=s(function(w6e,q2){"use strict";var Ype=y2();q2.exports=Ype});var R2=s(function(S6e,L2){"use strict";var ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),uf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),w2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Hpe=require("@stdlib/utils/constant-function"),Zpe=require("@stdlib/utils/noop"),Qpe=require("@stdlib/object/assign"),$pe=require("@stdlib/assert/is-number").isPrimitive,Kpe=require("@stdlib/math/base/assert/is-nan"),eye=require("@stdlib/assert/is-plain-object"),rye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,tye=require("@stdlib/assert/is-positive-number").isPrimitive,iye=require("@stdlib/assert/has-own-property"),S2=require("@stdlib/constants/float64/max"),O2=vn().factory,N2=require("@stdlib/symbol/iterator"),of=require("@stdlib/string/format");function E2(r,e,i){var t,n,a,u,o;if(!$pe(r)||Kpe(r))throw new TypeError(of("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!tye(e))throw new TypeError(of("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!eye(i))throw new TypeError(of("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=Qpe({},i),iye(t,"iter")){if(!rye(t.iter))throw new TypeError(of("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=S2;a=O2(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=O2(r,e),t={iter:S2,state:a.state};return o=0,n={},ii(n,"next",g),ii(n,"return",f),t&&t.prng?(ii(n,"seed",null),ii(n,"seedLength",null),w2(n,"state",Hpe(null),Zpe),ii(n,"stateLength",null),ii(n,"byteLength",null)):(uf(n,"seed",c),uf(n,"seedLength",h),w2(n,"state",l,v),uf(n,"stateLength",y),uf(n,"byteLength",d)),ii(n,"PRNG",a.PRNG),N2&&ii(n,N2,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return E2(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}L2.exports=E2});var _2=s(function(O6e,P2){"use strict";var nye=R2();P2.exports=nye});var F2=s(function(N6e,V2){"use strict";var ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),gf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),T2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),aye=require("@stdlib/utils/constant-function"),sye=require("@stdlib/utils/noop"),uye=require("@stdlib/object/assign"),j2=require("@stdlib/assert/is-positive-number").isPrimitive,oye=require("@stdlib/assert/is-plain-object"),gye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,vye=require("@stdlib/assert/has-own-property"),M2=require("@stdlib/constants/float64/max"),x2=ou().factory,G2=require("@stdlib/symbol/iterator"),vf=require("@stdlib/string/format");function A2(r,e,i){var t,n,a,u,o;if(!j2(r))throw new TypeError(vf("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!j2(e))throw new TypeError(vf("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!oye(i))throw new TypeError(vf("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=uye({},i),vye(t,"iter")){if(!gye(t.iter))throw new TypeError(vf("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=M2;a=x2(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=x2(r,e),t={iter:M2,state:a.state};return o=0,n={},ni(n,"next",g),ni(n,"return",f),t&&t.prng?(ni(n,"seed",null),ni(n,"seedLength",null),T2(n,"state",aye(null),sye),ni(n,"stateLength",null),ni(n,"byteLength",null)):(gf(n,"seed",c),gf(n,"seedLength",h),T2(n,"state",l,v),gf(n,"stateLength",y),gf(n,"byteLength",d)),ni(n,"PRNG",a.PRNG),G2&&ni(n,G2,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return A2(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}V2.exports=A2});var I2=s(function(E6e,W2){"use strict";var fye=F2();W2.exports=fye});var X2=s(function(L6e,B2){"use strict";var ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),ff=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),z2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dye=require("@stdlib/utils/constant-function"),lye=require("@stdlib/utils/noop"),cye=require("@stdlib/object/assign"),mye=require("@stdlib/assert/is-positive-number").isPrimitive,hye=require("@stdlib/assert/is-plain-object"),pye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,yye=require("@stdlib/assert/has-own-property"),k2=require("@stdlib/constants/float64/max"),J2=qa().factory,U2=require("@stdlib/symbol/iterator"),Om=require("@stdlib/string/format");function C2(r,e){var i,t,n,a,u;if(!mye(r))throw new TypeError(Om("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!hye(e))throw new TypeError(Om("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=cye({},e),yye(i,"iter")){if(!pye(i.iter))throw new TypeError(Om("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=k2;n=J2(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=J2(r),i={iter:k2,state:n.state};return u=0,t={},ai(t,"next",o),ai(t,"return",g),i&&i.prng?(ai(t,"seed",null),ai(t,"seedLength",null),z2(t,"state",dye(null),lye),ai(t,"stateLength",null),ai(t,"byteLength",null)):(ff(t,"seed",m),ff(t,"seedLength",c),z2(t,"state",d,l),ff(t,"stateLength",h),ff(t,"byteLength",y)),ai(t,"PRNG",n.PRNG),U2&&ai(t,U2,f),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function f(){return C2(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function h(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function d(){return n.PRNG.state}function l(v){n.PRNG.state=v}}B2.exports=C2});var Y2=s(function(R6e,D2){"use strict";var qye=X2();D2.exports=qye});var rF=s(function(P6e,eF){"use strict";var df=require("@stdlib/utils/define-nonenumerable-read-only-property"),lf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bye=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wye=require("@stdlib/object/assign"),Sye=require("@stdlib/assert/is-plain-object"),Oye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nye=require("@stdlib/assert/has-own-property"),H2=require("@stdlib/constants/float64/max"),Z2=fu().factory,Q2=require("@stdlib/symbol/iterator"),$2=require("@stdlib/string/format");function K2(r){var e,i,t,n,a;if(arguments.length>0){if(!Sye(r))throw new TypeError($2("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=wye({},r),Nye(e,"iter")){if(!Oye(e.iter))throw new TypeError($2("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=H2;t=Z2(e),e.copy!==!1&&(e.state=t.state)}else t=Z2(),e={iter:H2,state:t.state};return a=0,i={},df(i,"next",u),df(i,"return",o),lf(i,"seed",f),lf(i,"seedLength",m),bye(i,"state",y,d),lf(i,"stateLength",c),lf(i,"byteLength",h),df(i,"PRNG",t.PRNG),Q2&&df(i,Q2,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return K2(e)}function f(){return t.PRNG.seed}function m(){return t.PRNG.seedLength}function c(){return t.PRNG.stateLength}function h(){return t.PRNG.byteLength}function y(){return t.PRNG.state}function d(l){t.PRNG.state=l}}eF.exports=K2});var iF=s(function(_6e,tF){"use strict";var Eye=rF();tF.exports=Eye});var fF=s(function(T6e,vF){"use strict";var si=require("@stdlib/utils/define-nonenumerable-read-only-property"),cf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),nF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lye=require("@stdlib/utils/constant-function"),Rye=require("@stdlib/utils/noop"),Pye=require("@stdlib/object/assign"),_ye=require("@stdlib/assert/is-plain-object"),Tye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jye=require("@stdlib/assert/has-own-property"),aF=require("@stdlib/constants/float64/max"),sF=lu().factory,uF=require("@stdlib/symbol/iterator"),oF=require("@stdlib/string/format");function gF(r){var e,i,t,n,a;if(arguments.length>0){if(!_ye(r))throw new TypeError(oF("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Pye({},r),jye(e,"iter")){if(!Tye(e.iter))throw new TypeError(oF("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=aF;t=sF(e),e.prng===void 0&&e.copy!==!1&&(e.state=t.state)}else t=sF(),e={iter:aF,state:t.state};return a=0,i={},si(i,"next",u),si(i,"return",o),e&&e.prng?(si(i,"seed",null),si(i,"seedLength",null),nF(i,"state",Lye(null),Rye),si(i,"stateLength",null),si(i,"byteLength",null)):(cf(i,"seed",f),cf(i,"seedLength",m),nF(i,"state",y,d),cf(i,"stateLength",c),cf(i,"byteLength",h)),si(i,"PRNG",t.PRNG),uF&&si(i,uF,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return gF(e)}function f(){return t.PRNG.seed}function m(){return t.PRNG.seedLength}function c(){return t.PRNG.stateLength}function h(){return t.PRNG.byteLength}function y(){return t.PRNG.state}function d(l){t.PRNG.state=l}}vF.exports=gF});var lF=s(function(j6e,dF){"use strict";var Mye=fF();dF.exports=Mye});var bF=s(function(M6e,qF){"use strict";var mf=require("@stdlib/utils/define-nonenumerable-read-only-property"),hf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xye=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Gye=require("@stdlib/object/assign"),Aye=require("@stdlib/assert/is-plain-object"),Vye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fye=require("@stdlib/assert/has-own-property"),cF=require("@stdlib/constants/float64/max"),mF=bt().factory,hF=require("@stdlib/symbol/iterator"),pF=require("@stdlib/string/format");function yF(r){var e,i,t,n,a;if(arguments.length>0){if(!Aye(r))throw new TypeError(pF("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Gye({},r),Fye(e,"iter")){if(!Vye(e.iter))throw new TypeError(pF("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=cF;t=mF(e),e.copy!==!1&&(e.state=t.state)}else t=mF(),e={iter:cF,state:t.state};return a=0,i={},mf(i,"next",u),mf(i,"return",o),hf(i,"seed",f),hf(i,"seedLength",m),xye(i,"state",y,d),hf(i,"stateLength",c),hf(i,"byteLength",h),mf(i,"PRNG",t.PRNG),hF&&mf(i,hF,g),i;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:t(),done:!1}}function o(l){return n=!0,arguments.length?{value:l,done:!0}:{done:!0}}function g(){return yF(e)}function f(){return t.PRNG.seed}function m(){return t.PRNG.seedLength}function c(){return t.PRNG.stateLength}function h(){return t.PRNG.byteLength}function y(){return t.PRNG.state}function d(l){t.PRNG.state=l}}qF.exports=yF});var SF=s(function(x6e,wF){"use strict";var Wye=bF();wF.exports=Wye});var _F=s(function(G6e,PF){"use strict";var ui=require("@stdlib/utils/define-nonenumerable-read-only-property"),pf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),OF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Iye=require("@stdlib/utils/constant-function"),zye=require("@stdlib/utils/noop"),kye=require("@stdlib/object/assign"),Jye=require("@stdlib/assert/is-positive-number").isPrimitive,Uye=require("@stdlib/assert/is-plain-object"),Cye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Bye=require("@stdlib/assert/has-own-property"),NF=require("@stdlib/constants/float64/max"),EF=cu().factory,LF=require("@stdlib/symbol/iterator"),Nm=require("@stdlib/string/format");function RF(r,e){var i,t,n,a,u;if(!Jye(r))throw new TypeError(Nm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Uye(e))throw new TypeError(Nm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=kye({},e),Bye(i,"iter")){if(!Cye(i.iter))throw new TypeError(Nm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=NF;n=EF(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=EF(r),i={iter:NF,state:n.state};return u=0,t={},ui(t,"next",o),ui(t,"return",g),i&&i.prng?(ui(t,"seed",null),ui(t,"seedLength",null),OF(t,"state",Iye(null),zye),ui(t,"stateLength",null),ui(t,"byteLength",null)):(pf(t,"seed",m),pf(t,"seedLength",c),OF(t,"state",d,l),pf(t,"stateLength",h),pf(t,"byteLength",y)),ui(t,"PRNG",n.PRNG),LF&&ui(t,LF,f),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function f(){return RF(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function h(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function d(){return n.PRNG.state}function l(v){n.PRNG.state=v}}PF.exports=RF});var jF=s(function(A6e,TF){"use strict";var Xye=_F();TF.exports=Xye});var WF=s(function(V6e,FF){"use strict";var oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),yf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),MF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Dye=require("@stdlib/utils/constant-function"),Yye=require("@stdlib/utils/noop"),Hye=require("@stdlib/object/assign"),Zye=require("@stdlib/assert/is-positive-number").isPrimitive,Qye=require("@stdlib/assert/is-plain-object"),$ye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kye=require("@stdlib/assert/has-own-property"),xF=require("@stdlib/constants/float64/max"),GF=mu().factory,AF=require("@stdlib/symbol/iterator"),Em=require("@stdlib/string/format");function VF(r,e){var i,t,n,a,u;if(!Zye(r))throw new TypeError(Em("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Qye(e))throw new TypeError(Em("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i=Hye({},e),Kye(i,"iter")){if(!$ye(i.iter))throw new TypeError(Em("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=xF;n=GF(r,i),i.prng===void 0&&i.copy!==!1&&(i.state=n.state)}else n=GF(r),i={iter:xF,state:n.state};return u=0,t={},oi(t,"next",o),oi(t,"return",g),i&&i.prng?(oi(t,"seed",null),oi(t,"seedLength",null),MF(t,"state",Dye(null),Yye),oi(t,"stateLength",null),oi(t,"byteLength",null)):(yf(t,"seed",m),yf(t,"seedLength",c),MF(t,"state",d,l),yf(t,"stateLength",h),yf(t,"byteLength",y)),oi(t,"PRNG",n.PRNG),AF&&oi(t,AF,f),t;function o(){return u+=1,a||u>i.iter?{done:!0}:{value:n(),done:!1}}function g(v){return a=!0,arguments.length?{value:v,done:!0}:{done:!0}}function f(){return VF(r,i)}function m(){return n.PRNG.seed}function c(){return n.PRNG.seedLength}function h(){return n.PRNG.stateLength}function y(){return n.PRNG.byteLength}function d(){return n.PRNG.state}function l(v){n.PRNG.state=v}}FF.exports=VF});var zF=s(function(F6e,IF){"use strict";var eqe=WF();IF.exports=eqe});var DF=s(function(W6e,XF){"use strict";var gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),qf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rqe=require("@stdlib/utils/constant-function"),tqe=require("@stdlib/utils/noop"),iqe=require("@stdlib/object/assign"),Lm=require("@stdlib/assert/is-number").isPrimitive,Rm=require("@stdlib/math/base/assert/is-nan"),nqe=require("@stdlib/assert/is-plain-object"),aqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,sqe=require("@stdlib/assert/has-own-property"),JF=require("@stdlib/constants/float64/max"),UF=hu().factory,CF=require("@stdlib/symbol/iterator"),La=require("@stdlib/string/format");function BF(r,e,i,t){var n,a,u,o,g;if(!Lm(r)||Rm(r))throw new TypeError(La("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Lm(e)||Rm(e))throw new TypeError(La("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!Lm(i)||Rm(i))throw new TypeError(La("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",i));if(!(r<=i&&i<=e))throw new RangeError(La("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,i));if(arguments.length>3){if(!nqe(t))throw new TypeError(La("invalid argument. Options argument must be an object. Value: `%s`.",t));if(n=iqe({},t),sqe(n,"iter")){if(!aqe(n.iter))throw new TypeError(La("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=JF;u=UF(r,e,i,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=UF(r,e,i),n={iter:JF,state:u.state};return g=0,a={},gi(a,"next",f),gi(a,"return",m),n&&n.prng?(gi(a,"seed",null),gi(a,"seedLength",null),kF(a,"state",rqe(null),tqe),gi(a,"stateLength",null),gi(a,"byteLength",null)):(qf(a,"seed",h),qf(a,"seedLength",y),kF(a,"state",v,p),qf(a,"stateLength",d),qf(a,"byteLength",l)),gi(a,"PRNG",u.PRNG),CF&&gi(a,CF,c),a;function f(){return g+=1,o||g>n.iter?{done:!0}:{value:u(),done:!1}}function m(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function c(){return BF(r,e,i,n)}function h(){return u.PRNG.seed}function y(){return u.PRNG.seedLength}function d(){return u.PRNG.stateLength}function l(){return u.PRNG.byteLength}function v(){return u.PRNG.state}function p(q){u.PRNG.state=q}}XF.exports=BF});var HF=s(function(I6e,YF){"use strict";var uqe=DF();YF.exports=uqe});var nW=s(function(z6e,iW){"use strict";var vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),bf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ZF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),oqe=require("@stdlib/utils/constant-function"),gqe=require("@stdlib/utils/noop"),vqe=require("@stdlib/object/assign"),QF=require("@stdlib/assert/is-number").isPrimitive,$F=require("@stdlib/math/base/assert/is-nan"),fqe=require("@stdlib/assert/is-plain-object"),dqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,lqe=require("@stdlib/assert/has-own-property"),KF=require("@stdlib/constants/float64/max"),eW=fn().factory,rW=require("@stdlib/symbol/iterator"),bu=require("@stdlib/string/format");function tW(r,e,i){var t,n,a,u,o;if(!QF(r)||$F(r))throw new TypeError(bu("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!QF(e)||$F(e))throw new TypeError(bu("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(bu("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(arguments.length>2){if(!fqe(i))throw new TypeError(bu("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=vqe({},i),lqe(t,"iter")){if(!dqe(t.iter))throw new TypeError(bu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=KF;a=eW(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=eW(r,e),t={iter:KF,state:a.state};return o=0,n={},vi(n,"next",g),vi(n,"return",f),t&&t.prng?(vi(n,"seed",null),vi(n,"seedLength",null),ZF(n,"state",oqe(null),gqe),vi(n,"stateLength",null),vi(n,"byteLength",null)):(bf(n,"seed",c),bf(n,"seedLength",h),ZF(n,"state",l,v),bf(n,"stateLength",y),bf(n,"byteLength",d)),vi(n,"PRNG",a.PRNG),rW&&vi(n,rW,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return tW(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}iW.exports=tW});var sW=s(function(k6e,aW){"use strict";var cqe=nW();aW.exports=cqe});var cW=s(function(J6e,lW){"use strict";var fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),wf=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),uW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),mqe=require("@stdlib/utils/constant-function"),hqe=require("@stdlib/utils/noop"),pqe=require("@stdlib/object/assign"),oW=require("@stdlib/assert/is-positive-number").isPrimitive,yqe=require("@stdlib/assert/is-plain-object"),qqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bqe=require("@stdlib/assert/has-own-property"),gW=require("@stdlib/constants/float64/max"),vW=Ea().factory,fW=require("@stdlib/symbol/iterator"),Sf=require("@stdlib/string/format");function dW(r,e,i){var t,n,a,u,o;if(!oW(r))throw new TypeError(Sf("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!oW(e))throw new TypeError(Sf("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!yqe(i))throw new TypeError(Sf("invalid argument. Options argument must be an object. Value: `%s`.",i));if(t=pqe({},i),bqe(t,"iter")){if(!qqe(t.iter))throw new TypeError(Sf("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=gW;a=vW(r,e,t),t.prng===void 0&&t.copy!==!1&&(t.state=a.state)}else a=vW(r,e),t={iter:gW,state:a.state};return o=0,n={},fi(n,"next",g),fi(n,"return",f),t&&t.prng?(fi(n,"seed",null),fi(n,"seedLength",null),uW(n,"state",mqe(null),hqe),fi(n,"stateLength",null),fi(n,"byteLength",null)):(wf(n,"seed",c),wf(n,"seedLength",h),uW(n,"state",l,v),wf(n,"stateLength",y),wf(n,"byteLength",d)),fi(n,"PRNG",a.PRNG),fW&&fi(n,fW,m),n;function g(){return o+=1,u||o>t.iter?{done:!0}:{value:a(),done:!1}}function f(p){return u=!0,arguments.length?{value:p,done:!0}:{done:!0}}function m(){return dW(r,e,t)}function c(){return a.PRNG.seed}function h(){return a.PRNG.seedLength}function y(){return a.PRNG.stateLength}function d(){return a.PRNG.byteLength}function l(){return a.PRNG.state}function v(p){a.PRNG.state=p}}lW.exports=dW});var hW=s(function(U6e,mW){"use strict";var wqe=cW();mW.exports=wqe});var yW=s(function(C6e,pW){"use strict";var _=require("@stdlib/utils/define-read-only-property"),R={};_(R,"arcsine",q1());_(R,"bernoulli",P1());_(R,"beta",W1());_(R,"betaprime",Y1());_(R,"binomial",ix());_(R,"boxMuller",lx());_(R,"cauchy",Sx());_(R,"chi",jx());_(R,"chisquare",zx());_(R,"cosine",Hx());_(R,"discreteUniform",aG());_(R,"erlang",cG());_(R,"exponential",OG());_(R,"f",xG());_(R,"frechet",UG());_(R,"gamma",KG());_(R,"geometric",oA());_(R,"gumbel",pA());_(R,"hypergeometric",LA());_(R,"improvedZiggurat",VA());_(R,"invgamma",XA());_(R,"kumaraswamy",tV());_(R,"laplace",fV());_(R,"levy",bV());_(R,"logistic",_V());_(R,"lognormal",WV());_(R,"minstd",DV());_(R,"minstdShuffle",t2());_(R,"mt19937",f2());_(R,"negativeBinomial",b2());_(R,"normal",_2());_(R,"pareto1",I2());_(R,"poisson",Y2());_(R,"randi",iF());_(R,"randn",lF());_(R,"randu",SF());_(R,"rayleigh",jF());_(R,"t",zF());_(R,"triangular",HF());_(R,"uniform",sW());_(R,"weibull",hW());pW.exports=R});var bW=s(function(B6e,qW){"use strict";var Sqe=require("@stdlib/math/base/special/floor");function Oqe(r,e,i){var t,n,a,u;for(a=r.length,n=new Array(e),u=0;u0;a--)u=Eqe(i()*(a+1)),t=r[a],r[a]=r[u],r[u]=t;return Lqe.call(r,0,e)}OW.exports=Rqe});var LW=s(function(Y6e,EW){"use strict";var Pqe=require("@stdlib/math/base/special/floor");function _qe(r,e,i,t){var n,a,u,o,g,f,m,c,h,y;for(u=t.slice(),f=r.length,n=[],a=[],h=0;h1){if(e=arguments[0],r=arguments[1],!(Pm(e)||_m(e)))throw new TypeError(Nf("invalid argument. `%s` argument must be array-like. Value: `%s`.","pool",e));n=Ef(i,r)}if(n)throw n;return r&&r.seed?t=xW({seed:r.seed}):t=xW(),e===void 0?a=u:(MW(e)?e=e.split(""):e=GW(e),a=o),jW(a,"seed",t.seed),jW(a,"PRNG",t),t=t.normalized,a;function u(g,f){var m,c,h,y,d,l;if(!(Pm(g)||_m(g)))throw new TypeError(Nf("invalid argument. First argument must be array-like. Value: `%s`.",g));if(MW(g)&&(g=g.split("")),y={},arguments.length>1&&(l=Ef(y,f),l))throw l;if(y.replace===void 0?m=i.replace:m=y.replace,y.probs!==void 0&&(h=y.probs),y.size?d=y.size:i.size?d=i.size:d=g.length,m===!1&&d>g.length)throw new RangeError(Nf("invalid option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `%s`.",d));return h?m?Vqe(g,d,t,h):Aqe(g,d,t,h):m?AW(g,d,t):(c=Wqe.call(g),VW(c,d,t))}function o(g){var f,m,c,h,y,d;if(e.length===0)return null;if(c={},arguments.length&&(y=Ef(c,g),y))throw y;if(c.mutate===void 0?m=i.mutate:m=c.mutate,c.replace===void 0?f=i.replace:f=c.replace,c.size?h=c.size:i.size?h=i.size:h=e.length,f===!1&&h>e.length)throw new RangeError(Nf("invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.",h));return f?AW(e,h,t):(d=VW(e,h,t),m&&(e=e.slice(h,e.length)),d)}}FW.exports=Iqe});var IW=s(function($6e,WW){"use strict";var zqe=Tm(),kqe=zqe();WW.exports=kqe});var JW=s(function(K6e,kW){"use strict";var Jqe=require("@stdlib/utils/define-nonenumerable-read-only-property"),zW=IW(),Uqe=Tm();Jqe(zW,"factory",Uqe);kW.exports=zW});var UW=s(function(e4e,Cqe){Cqe.exports={copy:"shallow"}});var XW=s(function(r4e,BW){"use strict";var Bqe=require("@stdlib/assert/has-own-property"),Xqe=require("@stdlib/assert/is-string").isPrimitive,Dqe=require("@stdlib/assert/is-plain-object"),Yqe=require("@stdlib/utils/index-of"),jm=require("@stdlib/string/format"),CW=["deep","shallow","none"];function Hqe(r,e){if(!Dqe(e))return new TypeError(jm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(Bqe(e,"copy")){if(r.copy=e.copy,!Xqe(r.copy))return new TypeError(jm("invalid option. `%s` option must be a string. Option: `%s`.","copy",r.copy));if(Yqe(CW,r.copy)===-1)return new TypeError(jm('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"copy",CW.join('", "'),r.copy))}return null}BW.exports=Hqe});var Mm=s(function(t4e,QW){"use strict";var DW=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zqe=require("@stdlib/assert/is-array-like"),Qqe=require("@stdlib/assert/is-typed-array-like"),$qe=require("@stdlib/assert/is-string").isPrimitive,YW=require("@stdlib/utils/copy"),Kqe=require("@stdlib/math/base/special/floor"),HW=j().factory,ebe=require("@stdlib/string/format"),rbe=UW(),ZW=XW();function tbe(r){var e,i,t;if(e=YW(rbe),arguments.length&&(t=ZW(e,r),t))throw t;return r&&r.seed?i=HW({seed:r.seed}):i=HW(),DW(n,"seed",i.seed),DW(n,"PRNG",i),i=i.normalized,n;function n(a,u){var o,g,f,m,c,h,y,d,l,v;if(!(Zqe(a)||Qqe(a)))throw new TypeError(ebe("invalid argument. First argument must be array-like. Value: `%s`.",a));if(arguments.length>1&&(m={},c=ZW(m,u),c))throw c;for(f=m&&m.copy?m.copy:e.copy,o=$qe(a),o&&(a=a.split(""),f="none"),g=0,f==="shallow"?g+=1:f==="deep"&&(g+=2),d=a.length,h=YW(a,g),l=d-1;l>0;l--)v=Kqe(i()*(l+1)),y=h[l],h[l]=h[v],h[v]=y;return o&&(h=a.join("")),h}}QW.exports=tbe});var KW=s(function(i4e,$W){"use strict";var ibe=Mm(),nbe=ibe();$W.exports=nbe});var tI=s(function(n4e,rI){"use strict";var abe=require("@stdlib/utils/define-nonenumerable-read-only-property"),eI=KW(),sbe=Mm();abe(eI,"factory",sbe);rI.exports=eI});var iI=s(function(a4e,ube){ube.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var sI=s(function(s4e,aI){"use strict";var obe=require("@stdlib/assert/is-plain-object"),Xe=require("@stdlib/assert/has-own-property"),gbe=require("@stdlib/assert/is-boolean").isPrimitive,vbe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,nI=require("@stdlib/assert/is-string").isPrimitive,fbe=require("@stdlib/assert/is-positive-integer").isPrimitive,dbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ln=require("@stdlib/string/format");function lbe(r,e){return obe(e)?Xe(e,"sep")&&(r.sep=e.sep,!nI(r.sep))?new TypeError(ln("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Xe(e,"objectMode")&&(r.objectMode=e.objectMode,!gbe(r.objectMode))?new TypeError(ln("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Xe(e,"encoding")&&(r.encoding=e.encoding,!nI(r.encoding)&&r.encoding!==null)?new TypeError(ln("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Xe(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!vbe(r.highWaterMark))?new TypeError(ln("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Xe(e,"iter")&&(r.iter=e.iter,!dbe(r.iter))?new TypeError(ln("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Xe(e,"siter")&&(r.siter=e.siter,!fbe(r.siter))?new TypeError(ln("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Xe(e,"prng")&&(r.prng=e.prng),Xe(e,"seed")&&(r.seed=e.seed),Xe(e,"state")&&(r.state=e.state),Xe(e,"copy")&&(r.copy=e.copy),null):new TypeError(ln("invalid argument. Options argument must be an object. Value: `%s`.",e))}aI.exports=lbe});var oI=s(function(u4e,uI){"use strict";var cbe=require("debug"),mbe=cbe("random:streams:arcsine");uI.exports=mbe});var Rf=s(function(o4e,cI){"use strict";var lI=require("readable-stream").Readable,gI=require("@stdlib/assert/is-number").isPrimitive,vI=require("@stdlib/math/base/assert/is-nan"),hbe=require("@stdlib/assert/is-error"),pbe=require("@stdlib/object/assign"),ybe=require("@stdlib/utils/inherit"),fI=require("@stdlib/utils/define-nonenumerable-property"),di=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lf=require("@stdlib/utils/define-read-only-accessor"),qbe=require("@stdlib/utils/define-read-write-accessor"),bbe=en().factory,dI=require("@stdlib/buffer/from-string"),wbe=require("@stdlib/utils/next-tick"),xm=require("@stdlib/string/format"),Sbe=iI(),Obe=sI(),Ra=oI();function Nbe(){return this._prng.seed}function Ebe(){return this._prng.seedLength}function Lbe(){return this._prng.stateLength}function Rbe(){return this._prng.byteLength}function Pbe(){return this._prng.state}function _be(r){this._prng.state=r}function Tbe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ra("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ra("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=dI(e):e=dI(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function jbe(r){var e;if(this._destroyed)return Ra("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,wbe(i),this;function i(){r&&(Ra("Stream was destroyed due to an error. Error: %s.",hbe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ra("Closing the stream..."),e.emit("close")}}function ee(r,e,i){var t,n;if(!(this instanceof ee))return arguments.length>2?new ee(r,e,i):new ee(r,e);if(!gI(r)||vI(r))throw new TypeError(xm("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!gI(e)||vI(e))throw new TypeError(xm("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(xm("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(t=pbe({},Sbe),arguments.length>2&&(n=Obe(t,i),n))throw n;return Ra("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),lI.call(this,t),fI(this,"_destroyed",!1),di(this,"_objectMode",t.objectMode),di(this,"_sep",t.sep),di(this,"_iter",t.iter),di(this,"_siter",t.siter),fI(this,"_i",0),di(this,"_prng",bbe(r,e,t)),di(this,"PRNG",this._prng.PRNG),this}ybe(ee,lI);Lf(ee.prototype,"seed",Nbe);Lf(ee.prototype,"seedLength",Ebe);qbe(ee.prototype,"state",Pbe,_be);Lf(ee.prototype,"stateLength",Lbe);Lf(ee.prototype,"byteLength",Rbe);di(ee.prototype,"_read",Tbe);di(ee.prototype,"destroy",jbe);cI.exports=ee});var hI=s(function(g4e,mI){"use strict";var Mbe=require("@stdlib/assert/is-plain-object"),xbe=require("@stdlib/string/format"),Gbe=require("@stdlib/object/assign"),Abe=Rf();function Vbe(r,e,i){var t;if(arguments.length>2){if(t=i,!Mbe(t))throw new TypeError(xbe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=Gbe({},i)}else t={};return t.objectMode=!0,new Abe(r,e,t)}mI.exports=Vbe});var SI=s(function(v4e,wI){"use strict";var pI=require("@stdlib/assert/is-plain-object"),yI=require("@stdlib/object/assign"),qI=require("@stdlib/string/format"),bI=Rf();function Fbe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!pI(r))throw new TypeError(qI("invalid argument. Options argument must be an object. Value: `%s`.",r));n=yI({},r)}else if(t>2){if(!pI(i))throw new TypeError(qI("invalid argument. Options argument must be an object. Value: `%s`.",i));n=yI({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new bI(g,f,n)}function o(){return new bI(r,e,n)}}wI.exports=Fbe});var EI=s(function(f4e,NI){"use strict";var OI=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gm=Rf(),Wbe=hI(),Ibe=SI();OI(Gm,"objectMode",Wbe);OI(Gm,"factory",Ibe);NI.exports=Gm});var LI=s(function(d4e,zbe){zbe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var _I=s(function(l4e,PI){"use strict";var kbe=require("@stdlib/assert/is-plain-object"),De=require("@stdlib/assert/has-own-property"),Jbe=require("@stdlib/assert/is-boolean").isPrimitive,Ube=require("@stdlib/assert/is-nonnegative-number").isPrimitive,RI=require("@stdlib/assert/is-string").isPrimitive,Cbe=require("@stdlib/assert/is-positive-integer").isPrimitive,Bbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,cn=require("@stdlib/string/format");function Xbe(r,e){return kbe(e)?De(e,"sep")&&(r.sep=e.sep,!RI(r.sep))?new TypeError(cn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):De(e,"objectMode")&&(r.objectMode=e.objectMode,!Jbe(r.objectMode))?new TypeError(cn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):De(e,"encoding")&&(r.encoding=e.encoding,!RI(r.encoding)&&r.encoding!==null)?new TypeError(cn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):De(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Ube(r.highWaterMark))?new TypeError(cn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):De(e,"iter")&&(r.iter=e.iter,!Bbe(r.iter))?new TypeError(cn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):De(e,"siter")&&(r.siter=e.siter,!Cbe(r.siter))?new TypeError(cn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(De(e,"prng")&&(r.prng=e.prng),De(e,"seed")&&(r.seed=e.seed),De(e,"state")&&(r.state=e.state),De(e,"copy")&&(r.copy=e.copy),null):new TypeError(cn("invalid argument. Options argument must be an object. Value: `%s`.",e))}PI.exports=Xbe});var jI=s(function(c4e,TI){"use strict";var Dbe=require("debug"),Ybe=Dbe("random:streams:bernoulli");TI.exports=Ybe});var _f=s(function(m4e,AI){"use strict";var GI=require("readable-stream").Readable,Hbe=require("@stdlib/assert/is-probability").isPrimitive,Zbe=require("@stdlib/assert/is-error"),Qbe=require("@stdlib/object/assign"),$be=require("@stdlib/utils/inherit"),MI=require("@stdlib/utils/define-nonenumerable-property"),li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pf=require("@stdlib/utils/define-read-only-accessor"),Kbe=require("@stdlib/utils/define-read-write-accessor"),ewe=Bs().factory,xI=require("@stdlib/buffer/from-string"),rwe=require("@stdlib/utils/next-tick"),twe=require("@stdlib/string/format"),iwe=LI(),nwe=_I(),Pa=jI();function awe(){return this._prng.seed}function swe(){return this._prng.seedLength}function uwe(){return this._prng.stateLength}function owe(){return this._prng.byteLength}function gwe(){return this._prng.state}function vwe(r){this._prng.state=r}function fwe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Pa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Pa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=xI(e):e=xI(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function dwe(r){var e;if(this._destroyed)return Pa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rwe(i),this;function i(){r&&(Pa("Stream was destroyed due to an error. Error: %s.",Zbe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Pa("Closing the stream..."),e.emit("close")}}function re(r,e){var i,t;if(!(this instanceof re))return arguments.length>1?new re(r,e):new re(r);if(!Hbe(r))throw new TypeError(twe("invalid argument. First argument must be a probability. Value: `%s`.",r));if(i=Qbe({},iwe),arguments.length>1&&(t=nwe(i,e),t))throw t;return Pa("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),GI.call(this,i),MI(this,"_destroyed",!1),li(this,"_objectMode",i.objectMode),li(this,"_sep",i.sep),li(this,"_iter",i.iter),li(this,"_siter",i.siter),MI(this,"_i",0),li(this,"_prng",ewe(r,i)),li(this,"PRNG",this._prng.PRNG),this}$be(re,GI);Pf(re.prototype,"seed",awe);Pf(re.prototype,"seedLength",swe);Kbe(re.prototype,"state",gwe,vwe);Pf(re.prototype,"stateLength",uwe);Pf(re.prototype,"byteLength",owe);li(re.prototype,"_read",fwe);li(re.prototype,"destroy",dwe);AI.exports=re});var FI=s(function(h4e,VI){"use strict";var lwe=require("@stdlib/assert/is-plain-object"),cwe=require("@stdlib/string/format"),mwe=require("@stdlib/object/assign"),hwe=_f();function pwe(r,e){var i;if(arguments.length>1){if(i=e,!lwe(i))throw new TypeError(cwe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=mwe({},e)}else i={};return i.objectMode=!0,new hwe(r,i)}VI.exports=pwe});var UI=s(function(p4e,JI){"use strict";var WI=require("@stdlib/assert/is-plain-object"),ywe=require("@stdlib/assert/is-probability").isPrimitive,II=require("@stdlib/string/format"),zI=require("@stdlib/object/assign"),kI=_f();function qwe(r,e){var i,t,n;if(i=arguments.length,i>1){if(!WI(e))throw new TypeError(II("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=zI({},e)}else if(i===1)if(ywe(r))n=u,t={};else{if(!WI(r))throw new TypeError(II("invalid argument. Options argument must be an object. Value: `%s`.",r));t=zI({},r),n=a}else t={},n=a;return n;function a(o){return new kI(o,t)}function u(){return new kI(r,t)}}JI.exports=qwe});var XI=s(function(y4e,BI){"use strict";var CI=require("@stdlib/utils/define-nonenumerable-read-only-property"),Am=_f(),bwe=FI(),wwe=UI();CI(Am,"objectMode",bwe);CI(Am,"factory",wwe);BI.exports=Am});var DI=s(function(q4e,Swe){Swe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var ZI=s(function(b4e,HI){"use strict";var Owe=require("@stdlib/assert/is-plain-object"),Ye=require("@stdlib/assert/has-own-property"),Nwe=require("@stdlib/assert/is-boolean").isPrimitive,Ewe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,YI=require("@stdlib/assert/is-string").isPrimitive,Lwe=require("@stdlib/assert/is-positive-integer").isPrimitive,Rwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,mn=require("@stdlib/string/format");function Pwe(r,e){return Owe(e)?Ye(e,"sep")&&(r.sep=e.sep,!YI(r.sep))?new TypeError(mn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ye(e,"objectMode")&&(r.objectMode=e.objectMode,!Nwe(r.objectMode))?new TypeError(mn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ye(e,"encoding")&&(r.encoding=e.encoding,!YI(r.encoding)&&r.encoding!==null)?new TypeError(mn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ye(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Ewe(r.highWaterMark))?new TypeError(mn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ye(e,"iter")&&(r.iter=e.iter,!Rwe(r.iter))?new TypeError(mn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ye(e,"siter")&&(r.siter=e.siter,!Lwe(r.siter))?new TypeError(mn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ye(e,"prng")&&(r.prng=e.prng),Ye(e,"seed")&&(r.seed=e.seed),Ye(e,"state")&&(r.state=e.state),Ye(e,"copy")&&(r.copy=e.copy),null):new TypeError(mn("invalid argument. Options argument must be an object. Value: `%s`.",e))}HI.exports=Pwe});var $I=s(function(w4e,QI){"use strict";var _we=require("debug"),Twe=_we("random:streams:beta");QI.exports=Twe});var jf=s(function(S4e,nz){"use strict";var iz=require("readable-stream").Readable,KI=require("@stdlib/assert/is-positive-number").isPrimitive,jwe=require("@stdlib/assert/is-error"),Mwe=require("@stdlib/object/assign"),xwe=require("@stdlib/utils/inherit"),ez=require("@stdlib/utils/define-nonenumerable-property"),ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tf=require("@stdlib/utils/define-read-only-accessor"),Gwe=require("@stdlib/utils/define-read-write-accessor"),Awe=tn().factory,rz=require("@stdlib/buffer/from-string"),Vwe=require("@stdlib/utils/next-tick"),tz=require("@stdlib/string/format"),Fwe=DI(),Wwe=ZI(),_a=$I();function Iwe(){return this._prng.seed}function zwe(){return this._prng.seedLength}function kwe(){return this._prng.stateLength}function Jwe(){return this._prng.byteLength}function Uwe(){return this._prng.state}function Cwe(r){this._prng.state=r}function Bwe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return _a("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),_a("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=rz(e):e=rz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Xwe(r){var e;if(this._destroyed)return _a("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Vwe(i),this;function i(){r&&(_a("Stream was destroyed due to an error. Error: %s.",jwe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),_a("Closing the stream..."),e.emit("close")}}function te(r,e,i){var t,n;if(!(this instanceof te))return arguments.length>2?new te(r,e,i):new te(r,e);if(!KI(r))throw new TypeError(tz("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!KI(e))throw new TypeError(tz("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=Mwe({},Fwe),arguments.length>2&&(n=Wwe(t,i),n))throw n;return _a("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),iz.call(this,t),ez(this,"_destroyed",!1),ci(this,"_objectMode",t.objectMode),ci(this,"_sep",t.sep),ci(this,"_iter",t.iter),ci(this,"_siter",t.siter),ez(this,"_i",0),ci(this,"_prng",Awe(r,e,t)),ci(this,"PRNG",this._prng.PRNG),this}xwe(te,iz);Tf(te.prototype,"seed",Iwe);Tf(te.prototype,"seedLength",zwe);Gwe(te.prototype,"state",Uwe,Cwe);Tf(te.prototype,"stateLength",kwe);Tf(te.prototype,"byteLength",Jwe);ci(te.prototype,"_read",Bwe);ci(te.prototype,"destroy",Xwe);nz.exports=te});var sz=s(function(O4e,az){"use strict";var Dwe=require("@stdlib/assert/is-plain-object"),Ywe=require("@stdlib/string/format"),Hwe=require("@stdlib/object/assign"),Zwe=jf();function Qwe(r,e,i){var t;if(arguments.length>2){if(t=i,!Dwe(t))throw new TypeError(Ywe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=Hwe({},i)}else t={};return t.objectMode=!0,new Zwe(r,e,t)}az.exports=Qwe});var dz=s(function(N4e,fz){"use strict";var uz=require("@stdlib/assert/is-plain-object"),oz=require("@stdlib/object/assign"),gz=require("@stdlib/string/format"),vz=jf();function $we(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!uz(r))throw new TypeError(gz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=oz({},r)}else if(t>2){if(!uz(i))throw new TypeError(gz("invalid argument. Options argument must be an object. Value: `%s`.",i));n=oz({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new vz(g,f,n)}function o(){return new vz(r,e,n)}}fz.exports=$we});var mz=s(function(E4e,cz){"use strict";var lz=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vm=jf(),Kwe=sz(),eSe=dz();lz(Vm,"objectMode",Kwe);lz(Vm,"factory",eSe);cz.exports=Vm});var hz=s(function(L4e,rSe){rSe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var qz=s(function(R4e,yz){"use strict";var tSe=require("@stdlib/assert/is-plain-object"),He=require("@stdlib/assert/has-own-property"),iSe=require("@stdlib/assert/is-boolean").isPrimitive,nSe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,pz=require("@stdlib/assert/is-string").isPrimitive,aSe=require("@stdlib/assert/is-positive-integer").isPrimitive,sSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,hn=require("@stdlib/string/format");function uSe(r,e){return tSe(e)?He(e,"sep")&&(r.sep=e.sep,!pz(r.sep))?new TypeError(hn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):He(e,"objectMode")&&(r.objectMode=e.objectMode,!iSe(r.objectMode))?new TypeError(hn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):He(e,"encoding")&&(r.encoding=e.encoding,!pz(r.encoding)&&r.encoding!==null)?new TypeError(hn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):He(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!nSe(r.highWaterMark))?new TypeError(hn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):He(e,"iter")&&(r.iter=e.iter,!sSe(r.iter))?new TypeError(hn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):He(e,"siter")&&(r.siter=e.siter,!aSe(r.siter))?new TypeError(hn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(He(e,"prng")&&(r.prng=e.prng),He(e,"seed")&&(r.seed=e.seed),He(e,"state")&&(r.state=e.state),He(e,"copy")&&(r.copy=e.copy),null):new TypeError(hn("invalid argument. Options argument must be an object. Value: `%s`.",e))}yz.exports=uSe});var wz=s(function(P4e,bz){"use strict";var oSe=require("debug"),gSe=oSe("random:streams:betaprime");bz.exports=gSe});var xf=s(function(_4e,Rz){"use strict";var Lz=require("readable-stream").Readable,Sz=require("@stdlib/assert/is-positive-number").isPrimitive,vSe=require("@stdlib/assert/is-error"),fSe=require("@stdlib/object/assign"),dSe=require("@stdlib/utils/inherit"),Oz=require("@stdlib/utils/define-nonenumerable-property"),mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mf=require("@stdlib/utils/define-read-only-accessor"),lSe=require("@stdlib/utils/define-read-write-accessor"),cSe=nn().factory,Nz=require("@stdlib/buffer/from-string"),mSe=require("@stdlib/utils/next-tick"),Ez=require("@stdlib/string/format"),hSe=hz(),pSe=qz(),Ta=wz();function ySe(){return this._prng.seed}function qSe(){return this._prng.seedLength}function bSe(){return this._prng.stateLength}function wSe(){return this._prng.byteLength}function SSe(){return this._prng.state}function OSe(r){this._prng.state=r}function NSe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ta("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ta("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Nz(e):e=Nz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function ESe(r){var e;if(this._destroyed)return Ta("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,mSe(i),this;function i(){r&&(Ta("Stream was destroyed due to an error. Error: %s.",vSe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ta("Closing the stream..."),e.emit("close")}}function ie(r,e,i){var t,n;if(!(this instanceof ie))return arguments.length>2?new ie(r,e,i):new ie(r,e);if(!Sz(r))throw new TypeError(Ez("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!Sz(e))throw new TypeError(Ez("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=fSe({},hSe),arguments.length>2&&(n=pSe(t,i),n))throw n;return Ta("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Lz.call(this,t),Oz(this,"_destroyed",!1),mi(this,"_objectMode",t.objectMode),mi(this,"_sep",t.sep),mi(this,"_iter",t.iter),mi(this,"_siter",t.siter),Oz(this,"_i",0),mi(this,"_prng",cSe(r,e,t)),mi(this,"PRNG",this._prng.PRNG),this}dSe(ie,Lz);Mf(ie.prototype,"seed",ySe);Mf(ie.prototype,"seedLength",qSe);lSe(ie.prototype,"state",SSe,OSe);Mf(ie.prototype,"stateLength",bSe);Mf(ie.prototype,"byteLength",wSe);mi(ie.prototype,"_read",NSe);mi(ie.prototype,"destroy",ESe);Rz.exports=ie});var _z=s(function(T4e,Pz){"use strict";var LSe=require("@stdlib/assert/is-plain-object"),RSe=require("@stdlib/string/format"),PSe=require("@stdlib/object/assign"),_Se=xf();function TSe(r,e,i){var t;if(arguments.length>2){if(t=i,!LSe(t))throw new TypeError(RSe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=PSe({},i)}else t={};return t.objectMode=!0,new _Se(r,e,t)}Pz.exports=TSe});var Az=s(function(j4e,Gz){"use strict";var Tz=require("@stdlib/assert/is-plain-object"),jz=require("@stdlib/object/assign"),Mz=require("@stdlib/string/format"),xz=xf();function jSe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!Tz(r))throw new TypeError(Mz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=jz({},r)}else if(t>2){if(!Tz(i))throw new TypeError(Mz("invalid argument. Options argument must be an object. Value: `%s`.",i));n=jz({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new xz(g,f,n)}function o(){return new xz(r,e,n)}}Gz.exports=jSe});var Wz=s(function(M4e,Fz){"use strict";var Vz=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fm=xf(),MSe=_z(),xSe=Az();Vz(Fm,"objectMode",MSe);Vz(Fm,"factory",xSe);Fz.exports=Fm});var Iz=s(function(x4e,GSe){GSe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Jz=s(function(G4e,kz){"use strict";var ASe=require("@stdlib/assert/is-plain-object"),Ze=require("@stdlib/assert/has-own-property"),VSe=require("@stdlib/assert/is-boolean").isPrimitive,FSe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,zz=require("@stdlib/assert/is-string").isPrimitive,WSe=require("@stdlib/assert/is-positive-integer").isPrimitive,ISe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,pn=require("@stdlib/string/format");function zSe(r,e){return ASe(e)?Ze(e,"sep")&&(r.sep=e.sep,!zz(r.sep))?new TypeError(pn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ze(e,"objectMode")&&(r.objectMode=e.objectMode,!VSe(r.objectMode))?new TypeError(pn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ze(e,"encoding")&&(r.encoding=e.encoding,!zz(r.encoding)&&r.encoding!==null)?new TypeError(pn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ze(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!FSe(r.highWaterMark))?new TypeError(pn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ze(e,"iter")&&(r.iter=e.iter,!ISe(r.iter))?new TypeError(pn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ze(e,"siter")&&(r.siter=e.siter,!WSe(r.siter))?new TypeError(pn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ze(e,"prng")&&(r.prng=e.prng),Ze(e,"seed")&&(r.seed=e.seed),Ze(e,"state")&&(r.state=e.state),Ze(e,"copy")&&(r.copy=e.copy),null):new TypeError(pn("invalid argument. Options argument must be an object. Value: `%s`.",e))}kz.exports=zSe});var Cz=s(function(A4e,Uz){"use strict";var kSe=require("debug"),JSe=kSe("random:streams:binomial");Uz.exports=JSe});var Af=s(function(V4e,Hz){"use strict";var Yz=require("readable-stream").Readable,USe=require("@stdlib/assert/is-positive-integer").isPrimitive,CSe=require("@stdlib/assert/is-probability").isPrimitive,BSe=require("@stdlib/assert/is-error"),XSe=require("@stdlib/object/assign"),DSe=require("@stdlib/utils/inherit"),Bz=require("@stdlib/utils/define-nonenumerable-property"),hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gf=require("@stdlib/utils/define-read-only-accessor"),YSe=require("@stdlib/utils/define-read-write-accessor"),HSe=Xs().factory,Xz=require("@stdlib/buffer/from-string"),ZSe=require("@stdlib/utils/next-tick"),Dz=require("@stdlib/string/format"),QSe=Iz(),$Se=Jz(),ja=Cz();function KSe(){return this._prng.seed}function eOe(){return this._prng.seedLength}function rOe(){return this._prng.stateLength}function tOe(){return this._prng.byteLength}function iOe(){return this._prng.state}function nOe(r){this._prng.state=r}function aOe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ja("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ja("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Xz(e):e=Xz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function sOe(r){var e;if(this._destroyed)return ja("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,ZSe(i),this;function i(){r&&(ja("Stream was destroyed due to an error. Error: %s.",BSe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ja("Closing the stream..."),e.emit("close")}}function ne(r,e,i){var t,n;if(!(this instanceof ne))return arguments.length>2?new ne(r,e,i):new ne(r,e);if(!USe(r))throw new TypeError(Dz("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!CSe(e))throw new TypeError(Dz("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(t=XSe({},QSe),arguments.length>2&&(n=$Se(t,i),n))throw n;return ja("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Yz.call(this,t),Bz(this,"_destroyed",!1),hi(this,"_objectMode",t.objectMode),hi(this,"_sep",t.sep),hi(this,"_iter",t.iter),hi(this,"_siter",t.siter),Bz(this,"_i",0),hi(this,"_prng",HSe(r,e,t)),hi(this,"PRNG",this._prng.PRNG),this}DSe(ne,Yz);Gf(ne.prototype,"seed",KSe);Gf(ne.prototype,"seedLength",eOe);YSe(ne.prototype,"state",iOe,nOe);Gf(ne.prototype,"stateLength",rOe);Gf(ne.prototype,"byteLength",tOe);hi(ne.prototype,"_read",aOe);hi(ne.prototype,"destroy",sOe);Hz.exports=ne});var Qz=s(function(F4e,Zz){"use strict";var uOe=require("@stdlib/assert/is-plain-object"),oOe=require("@stdlib/object/assign"),gOe=require("@stdlib/string/format"),vOe=Af();function fOe(r,e,i){var t;if(arguments.length>2){if(t=i,!uOe(t))throw new TypeError(gOe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=oOe({},i)}else t={};return t.objectMode=!0,new vOe(r,e,t)}Zz.exports=fOe});var ik=s(function(W4e,tk){"use strict";var $z=require("@stdlib/assert/is-plain-object"),Kz=require("@stdlib/object/assign"),ek=require("@stdlib/string/format"),rk=Af();function dOe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!$z(r))throw new TypeError(ek("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Kz({},r)}else if(t>2){if(!$z(i))throw new TypeError(ek("invalid argument. Options argument must be an object. Value: `%s`.",i));n=Kz({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new rk(g,f,n)}function o(){return new rk(r,e,n)}}tk.exports=dOe});var sk=s(function(I4e,ak){"use strict";var nk=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wm=Af(),lOe=Qz(),cOe=ik();nk(Wm,"objectMode",lOe);nk(Wm,"factory",cOe);ak.exports=Wm});var uk=s(function(z4e,mOe){mOe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var vk=s(function(k4e,gk){"use strict";var hOe=require("@stdlib/assert/is-plain-object"),Qe=require("@stdlib/assert/has-own-property"),pOe=require("@stdlib/assert/is-boolean").isPrimitive,yOe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,ok=require("@stdlib/assert/is-string").isPrimitive,qOe=require("@stdlib/assert/is-positive-integer").isPrimitive,bOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,yn=require("@stdlib/string/format");function wOe(r,e){return hOe(e)?Qe(e,"sep")&&(r.sep=e.sep,!ok(r.sep))?new TypeError(yn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Qe(e,"objectMode")&&(r.objectMode=e.objectMode,!pOe(r.objectMode))?new TypeError(yn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Qe(e,"encoding")&&(r.encoding=e.encoding,!ok(r.encoding)&&r.encoding!==null)?new TypeError(yn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Qe(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!yOe(r.highWaterMark))?new TypeError(yn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Qe(e,"iter")&&(r.iter=e.iter,!bOe(r.iter))?new TypeError(yn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Qe(e,"siter")&&(r.siter=e.siter,!qOe(r.siter))?new TypeError(yn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Qe(e,"prng")&&(r.prng=e.prng),Qe(e,"seed")&&(r.seed=e.seed),Qe(e,"state")&&(r.state=e.state),Qe(e,"copy")&&(r.copy=e.copy),null):new TypeError(yn("invalid argument. Options argument must be an object. Value: `%s`.",e))}gk.exports=wOe});var dk=s(function(J4e,fk){"use strict";var SOe=require("debug"),OOe=SOe("random:streams:box-muller");fk.exports=OOe});var Ff=s(function(U4e,hk){"use strict";var mk=require("readable-stream").Readable,NOe=require("@stdlib/assert/is-error"),EOe=require("@stdlib/object/assign"),LOe=require("@stdlib/utils/inherit"),lk=require("@stdlib/utils/define-nonenumerable-property"),pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vf=require("@stdlib/utils/define-read-only-accessor"),ROe=require("@stdlib/utils/define-read-write-accessor"),POe=ca().factory,ck=require("@stdlib/buffer/from-string"),_Oe=require("@stdlib/utils/next-tick"),TOe=uk(),jOe=vk(),Ma=dk();function MOe(){return this._prng.seed}function xOe(){return this._prng.seedLength}function GOe(){return this._prng.stateLength}function AOe(){return this._prng.byteLength}function VOe(){return this._prng.state}function FOe(r){this._prng.state=r}function WOe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ma("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ma("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=ck(e):e=ck(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function IOe(r){var e;if(this._destroyed)return Ma("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,_Oe(i),this;function i(){r&&(Ma("Stream was destroyed due to an error. Error: %s.",NOe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ma("Closing the stream..."),e.emit("close")}}function ae(r){var e,i;if(!(this instanceof ae))return arguments.length>0?new ae(r):new ae;if(e=EOe({},TOe),arguments.length>0&&(i=jOe(e,r),i))throw i;return Ma("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),mk.call(this,e),lk(this,"_destroyed",!1),pi(this,"_objectMode",e.objectMode),pi(this,"_sep",e.sep),pi(this,"_iter",e.iter),pi(this,"_siter",e.siter),lk(this,"_i",0),pi(this,"_prng",POe(e)),pi(this,"PRNG",this._prng.PRNG),this}LOe(ae,mk);Vf(ae.prototype,"seed",MOe);Vf(ae.prototype,"seedLength",xOe);ROe(ae.prototype,"state",VOe,FOe);Vf(ae.prototype,"stateLength",GOe);Vf(ae.prototype,"byteLength",AOe);pi(ae.prototype,"_read",WOe);pi(ae.prototype,"destroy",IOe);hk.exports=ae});var yk=s(function(C4e,pk){"use strict";var zOe=require("@stdlib/assert/is-plain-object"),kOe=require("@stdlib/object/assign"),JOe=require("@stdlib/string/format"),UOe=Ff();function COe(r){var e;if(arguments.length>0){if(e=r,!zOe(e))throw new TypeError(JOe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=kOe({},r)}else e={};return e.objectMode=!0,new UOe(e)}pk.exports=COe});var bk=s(function(B4e,qk){"use strict";var BOe=require("@stdlib/assert/is-plain-object"),XOe=require("@stdlib/object/assign"),DOe=require("@stdlib/string/format"),YOe=Ff();function HOe(r){var e;if(arguments.length>0){if(!BOe(r))throw new TypeError(DOe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=XOe({},r)}else e={};return i;function i(){return new YOe(e)}}qk.exports=HOe});var Ok=s(function(X4e,Sk){"use strict";var wk=require("@stdlib/utils/define-nonenumerable-read-only-property"),Im=Ff(),ZOe=yk(),QOe=bk();wk(Im,"objectMode",ZOe);wk(Im,"factory",QOe);Sk.exports=Im});var Nk=s(function(D4e,$Oe){$Oe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Rk=s(function(Y4e,Lk){"use strict";var KOe=require("@stdlib/assert/is-plain-object"),$e=require("@stdlib/assert/has-own-property"),eNe=require("@stdlib/assert/is-boolean").isPrimitive,rNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Ek=require("@stdlib/assert/is-string").isPrimitive,tNe=require("@stdlib/assert/is-positive-integer").isPrimitive,iNe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qn=require("@stdlib/string/format");function nNe(r,e){return KOe(e)?$e(e,"sep")&&(r.sep=e.sep,!Ek(r.sep))?new TypeError(qn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):$e(e,"objectMode")&&(r.objectMode=e.objectMode,!eNe(r.objectMode))?new TypeError(qn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):$e(e,"encoding")&&(r.encoding=e.encoding,!Ek(r.encoding)&&r.encoding!==null)?new TypeError(qn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):$e(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!rNe(r.highWaterMark))?new TypeError(qn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):$e(e,"iter")&&(r.iter=e.iter,!iNe(r.iter))?new TypeError(qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):$e(e,"siter")&&(r.siter=e.siter,!tNe(r.siter))?new TypeError(qn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):($e(e,"prng")&&(r.prng=e.prng),$e(e,"seed")&&(r.seed=e.seed),$e(e,"state")&&(r.state=e.state),$e(e,"copy")&&(r.copy=e.copy),null):new TypeError(qn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Lk.exports=nNe});var _k=s(function(H4e,Pk){"use strict";var aNe=require("debug"),sNe=aNe("random:streams:cauchy");Pk.exports=sNe});var If=s(function(Z4e,Gk){"use strict";var xk=require("readable-stream").Readable,uNe=require("@stdlib/assert/is-positive-number").isPrimitive,oNe=require("@stdlib/assert/is-number").isPrimitive,gNe=require("@stdlib/math/base/assert/is-nan"),vNe=require("@stdlib/assert/is-error"),fNe=require("@stdlib/object/assign"),dNe=require("@stdlib/utils/inherit"),Tk=require("@stdlib/utils/define-nonenumerable-property"),yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wf=require("@stdlib/utils/define-read-only-accessor"),lNe=require("@stdlib/utils/define-read-write-accessor"),cNe=Hs().factory,jk=require("@stdlib/buffer/from-string"),mNe=require("@stdlib/utils/next-tick"),Mk=require("@stdlib/string/format"),hNe=Nk(),pNe=Rk(),xa=_k();function yNe(){return this._prng.seed}function qNe(){return this._prng.seedLength}function bNe(){return this._prng.stateLength}function wNe(){return this._prng.byteLength}function SNe(){return this._prng.state}function ONe(r){this._prng.state=r}function NNe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return xa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),xa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=jk(e):e=jk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function ENe(r){var e;if(this._destroyed)return xa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,mNe(i),this;function i(){r&&(xa("Stream was destroyed due to an error. Error: %s.",vNe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),xa("Closing the stream..."),e.emit("close")}}function se(r,e,i){var t,n;if(!(this instanceof se))return arguments.length>2?new se(r,e,i):new se(r,e);if(!oNe(r)||gNe(r))throw new TypeError(Mk("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!uNe(e))throw new TypeError(Mk("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=fNe({},hNe),arguments.length>2&&(n=pNe(t,i),n))throw n;return xa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),xk.call(this,t),Tk(this,"_destroyed",!1),yi(this,"_objectMode",t.objectMode),yi(this,"_sep",t.sep),yi(this,"_iter",t.iter),yi(this,"_siter",t.siter),Tk(this,"_i",0),yi(this,"_prng",cNe(r,e,t)),yi(this,"PRNG",this._prng.PRNG),this}dNe(se,xk);Wf(se.prototype,"seed",yNe);Wf(se.prototype,"seedLength",qNe);lNe(se.prototype,"state",SNe,ONe);Wf(se.prototype,"stateLength",bNe);Wf(se.prototype,"byteLength",wNe);yi(se.prototype,"_read",NNe);yi(se.prototype,"destroy",ENe);Gk.exports=se});var Vk=s(function(Q4e,Ak){"use strict";var LNe=require("@stdlib/assert/is-plain-object"),RNe=require("@stdlib/object/assign"),PNe=require("@stdlib/string/format"),_Ne=If();function TNe(r,e,i){var t;if(arguments.length>2){if(t=i,!LNe(t))throw new TypeError(PNe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=RNe({},i)}else t={};return t.objectMode=!0,new _Ne(r,e,t)}Ak.exports=TNe});var Jk=s(function($4e,kk){"use strict";var Fk=require("@stdlib/assert/is-plain-object"),Wk=require("@stdlib/object/assign"),Ik=require("@stdlib/string/format"),zk=If();function jNe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!Fk(r))throw new TypeError(Ik("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Wk({},r)}else if(t>2){if(!Fk(i))throw new TypeError(Ik("invalid argument. Options argument must be an object. Value: `%s`.",i));n=Wk({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new zk(g,f,n)}function o(){return new zk(r,e,n)}}kk.exports=jNe});var Bk=s(function(K4e,Ck){"use strict";var Uk=require("@stdlib/utils/define-nonenumerable-read-only-property"),zm=If(),MNe=Vk(),xNe=Jk();Uk(zm,"objectMode",MNe);Uk(zm,"factory",xNe);Ck.exports=zm});var Xk=s(function(eYe,GNe){GNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Hk=s(function(rYe,Yk){"use strict";var ANe=require("@stdlib/assert/is-plain-object"),Ke=require("@stdlib/assert/has-own-property"),VNe=require("@stdlib/assert/is-boolean").isPrimitive,FNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Dk=require("@stdlib/assert/is-string").isPrimitive,WNe=require("@stdlib/assert/is-positive-integer").isPrimitive,INe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bn=require("@stdlib/string/format");function zNe(r,e){return ANe(e)?Ke(e,"sep")&&(r.sep=e.sep,!Dk(r.sep))?new TypeError(bn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ke(e,"objectMode")&&(r.objectMode=e.objectMode,!VNe(r.objectMode))?new TypeError(bn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ke(e,"encoding")&&(r.encoding=e.encoding,!Dk(r.encoding)&&r.encoding!==null)?new TypeError(bn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ke(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!FNe(r.highWaterMark))?new TypeError(bn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ke(e,"iter")&&(r.iter=e.iter,!INe(r.iter))?new TypeError(bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ke(e,"siter")&&(r.siter=e.siter,!WNe(r.siter))?new TypeError(bn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ke(e,"prng")&&(r.prng=e.prng),Ke(e,"seed")&&(r.seed=e.seed),Ke(e,"state")&&(r.state=e.state),Ke(e,"copy")&&(r.copy=e.copy),null):new TypeError(bn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Yk.exports=zNe});var Qk=s(function(tYe,Zk){"use strict";var kNe=require("debug"),JNe=kNe("random:streams:chi");Zk.exports=JNe});var kf=s(function(iYe,r3){"use strict";var e3=require("readable-stream").Readable,UNe=require("@stdlib/assert/is-positive-number").isPrimitive,CNe=require("@stdlib/assert/is-error"),BNe=require("@stdlib/object/assign"),XNe=require("@stdlib/utils/inherit"),$k=require("@stdlib/utils/define-nonenumerable-property"),qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),zf=require("@stdlib/utils/define-read-only-accessor"),DNe=require("@stdlib/utils/define-read-write-accessor"),YNe=Zs().factory,Kk=require("@stdlib/buffer/from-string"),HNe=require("@stdlib/utils/next-tick"),ZNe=require("@stdlib/string/format"),QNe=Xk(),$Ne=Hk(),Ga=Qk();function KNe(){return this._prng.seed}function eEe(){return this._prng.seedLength}function rEe(){return this._prng.stateLength}function tEe(){return this._prng.byteLength}function iEe(){return this._prng.state}function nEe(r){this._prng.state=r}function aEe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ga("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ga("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Kk(e):e=Kk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function sEe(r){var e;if(this._destroyed)return Ga("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,HNe(i),this;function i(){r&&(Ga("Stream was destroyed due to an error. Error: %s.",CNe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ga("Closing the stream..."),e.emit("close")}}function ue(r,e){var i,t;if(!(this instanceof ue))return arguments.length>1?new ue(r,e):new ue(r);if(!UNe(r))throw new TypeError(ZNe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=BNe({},QNe),arguments.length>1&&(t=$Ne(i,e),t))throw t;return Ga("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),e3.call(this,i),$k(this,"_destroyed",!1),qi(this,"_objectMode",i.objectMode),qi(this,"_sep",i.sep),qi(this,"_iter",i.iter),qi(this,"_siter",i.siter),$k(this,"_i",0),qi(this,"_prng",YNe(r,i)),qi(this,"PRNG",this._prng.PRNG),this}XNe(ue,e3);zf(ue.prototype,"seed",KNe);zf(ue.prototype,"seedLength",eEe);DNe(ue.prototype,"state",iEe,nEe);zf(ue.prototype,"stateLength",rEe);zf(ue.prototype,"byteLength",tEe);qi(ue.prototype,"_read",aEe);qi(ue.prototype,"destroy",sEe);r3.exports=ue});var i3=s(function(nYe,t3){"use strict";var uEe=require("@stdlib/assert/is-plain-object"),oEe=require("@stdlib/object/assign"),gEe=require("@stdlib/string/format"),vEe=kf();function fEe(r,e){var i;if(arguments.length>1){if(i=e,!uEe(i))throw new TypeError(gEe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=oEe({},e)}else i={};return i.objectMode=!0,new vEe(r,i)}t3.exports=fEe});var g3=s(function(aYe,o3){"use strict";var n3=require("@stdlib/assert/is-plain-object"),dEe=require("@stdlib/assert/is-positive-number").isPrimitive,a3=require("@stdlib/object/assign"),s3=require("@stdlib/string/format"),u3=kf();function lEe(r,e){var i,t,n;if(i=arguments.length,i>1){if(!n3(e))throw new TypeError(s3("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=a3({},e)}else if(i===1)if(dEe(r))n=u,t={};else{if(!n3(r))throw new TypeError(s3("invalid argument. Options argument must be an object. Value: `%s`.",r));t=a3({},r),n=a}else t={},n=a;return n;function a(o){return new u3(o,t)}function u(){return new u3(r,t)}}o3.exports=lEe});var d3=s(function(sYe,f3){"use strict";var v3=require("@stdlib/utils/define-nonenumerable-read-only-property"),km=kf(),cEe=i3(),mEe=g3();v3(km,"objectMode",cEe);v3(km,"factory",mEe);f3.exports=km});var l3=s(function(uYe,hEe){hEe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var h3=s(function(oYe,m3){"use strict";var pEe=require("@stdlib/assert/is-plain-object"),er=require("@stdlib/assert/has-own-property"),yEe=require("@stdlib/assert/is-boolean").isPrimitive,qEe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,c3=require("@stdlib/assert/is-string").isPrimitive,bEe=require("@stdlib/assert/is-positive-integer").isPrimitive,wEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wn=require("@stdlib/string/format");function SEe(r,e){return pEe(e)?er(e,"sep")&&(r.sep=e.sep,!c3(r.sep))?new TypeError(wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):er(e,"objectMode")&&(r.objectMode=e.objectMode,!yEe(r.objectMode))?new TypeError(wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):er(e,"encoding")&&(r.encoding=e.encoding,!c3(r.encoding)&&r.encoding!==null)?new TypeError(wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!qEe(r.highWaterMark))?new TypeError(wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):er(e,"iter")&&(r.iter=e.iter,!wEe(r.iter))?new TypeError(wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):er(e,"siter")&&(r.siter=e.siter,!bEe(r.siter))?new TypeError(wn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(er(e,"prng")&&(r.prng=e.prng),er(e,"seed")&&(r.seed=e.seed),er(e,"state")&&(r.state=e.state),er(e,"copy")&&(r.copy=e.copy),null):new TypeError(wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}m3.exports=SEe});var y3=s(function(gYe,p3){"use strict";var OEe=require("debug"),NEe=OEe("random:streams:chisquare");p3.exports=NEe});var Uf=s(function(vYe,S3){"use strict";var w3=require("readable-stream").Readable,EEe=require("@stdlib/assert/is-positive-number").isPrimitive,LEe=require("@stdlib/assert/is-error"),REe=require("@stdlib/object/assign"),PEe=require("@stdlib/utils/inherit"),q3=require("@stdlib/utils/define-nonenumerable-property"),bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jf=require("@stdlib/utils/define-read-only-accessor"),_Ee=require("@stdlib/utils/define-read-write-accessor"),TEe=Ot().factory,b3=require("@stdlib/buffer/from-string"),jEe=require("@stdlib/utils/next-tick"),MEe=require("@stdlib/string/format"),xEe=l3(),GEe=h3(),Aa=y3();function AEe(){return this._prng.seed}function VEe(){return this._prng.seedLength}function FEe(){return this._prng.stateLength}function WEe(){return this._prng.byteLength}function IEe(){return this._prng.state}function zEe(r){this._prng.state=r}function kEe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Aa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Aa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=b3(e):e=b3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function JEe(r){var e;if(this._destroyed)return Aa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,jEe(i),this;function i(){r&&(Aa("Stream was destroyed due to an error. Error: %s.",LEe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Aa("Closing the stream..."),e.emit("close")}}function oe(r,e){var i,t;if(!(this instanceof oe))return arguments.length>1?new oe(r,e):new oe(r);if(!EEe(r))throw new TypeError(MEe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=REe({},xEe),arguments.length>1&&(t=GEe(i,e),t))throw t;return Aa("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),w3.call(this,i),q3(this,"_destroyed",!1),bi(this,"_objectMode",i.objectMode),bi(this,"_sep",i.sep),bi(this,"_iter",i.iter),bi(this,"_siter",i.siter),q3(this,"_i",0),bi(this,"_prng",TEe(r,i)),bi(this,"PRNG",this._prng.PRNG),this}PEe(oe,w3);Jf(oe.prototype,"seed",AEe);Jf(oe.prototype,"seedLength",VEe);_Ee(oe.prototype,"state",IEe,zEe);Jf(oe.prototype,"stateLength",FEe);Jf(oe.prototype,"byteLength",WEe);bi(oe.prototype,"_read",kEe);bi(oe.prototype,"destroy",JEe);S3.exports=oe});var N3=s(function(fYe,O3){"use strict";var UEe=require("@stdlib/assert/is-plain-object"),CEe=require("@stdlib/object/assign"),BEe=require("@stdlib/string/format"),XEe=Uf();function DEe(r,e){var i;if(arguments.length>1){if(i=e,!UEe(i))throw new TypeError(BEe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=CEe({},i)}else i={};return i.objectMode=!0,new XEe(r,i)}O3.exports=DEe});var T3=s(function(dYe,_3){"use strict";var YEe=require("@stdlib/assert/is-positive-number").isPrimitive,E3=require("@stdlib/assert/is-plain-object"),L3=require("@stdlib/object/assign"),R3=require("@stdlib/string/format"),P3=Uf();function HEe(r,e){var i,t,n;if(i=arguments.length,i>1){if(!E3(e))throw new TypeError(R3("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=L3({},e)}else if(i===1)if(YEe(r))n=u,t={};else{if(!E3(r))throw new TypeError(R3("invalid argument. Options argument must be an object. Value: `%s`.",r));t=L3({},r),n=a}else t={},n=a;return n;function a(o){return new P3(o,t)}function u(){return new P3(r,t)}}_3.exports=HEe});var x3=s(function(lYe,M3){"use strict";var j3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jm=Uf(),ZEe=N3(),QEe=T3();j3(Jm,"objectMode",ZEe);j3(Jm,"factory",QEe);M3.exports=Jm});var G3=s(function(cYe,$Ee){$Ee.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var F3=s(function(mYe,V3){"use strict";var KEe=require("@stdlib/assert/is-plain-object"),rr=require("@stdlib/assert/has-own-property"),eLe=require("@stdlib/assert/is-boolean").isPrimitive,rLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,A3=require("@stdlib/assert/is-string").isPrimitive,tLe=require("@stdlib/assert/is-positive-integer").isPrimitive,iLe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Sn=require("@stdlib/string/format");function nLe(r,e){return KEe(e)?rr(e,"sep")&&(r.sep=e.sep,!A3(r.sep))?new TypeError(Sn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):rr(e,"objectMode")&&(r.objectMode=e.objectMode,!eLe(r.objectMode))?new TypeError(Sn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):rr(e,"encoding")&&(r.encoding=e.encoding,!A3(r.encoding)&&r.encoding!==null)?new TypeError(Sn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!rLe(r.highWaterMark))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):rr(e,"iter")&&(r.iter=e.iter,!iLe(r.iter))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):rr(e,"siter")&&(r.siter=e.siter,!tLe(r.siter))?new TypeError(Sn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(rr(e,"prng")&&(r.prng=e.prng),rr(e,"seed")&&(r.seed=e.seed),rr(e,"state")&&(r.state=e.state),rr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Sn("invalid argument. Options argument must be an object. Value: `%s`.",e))}V3.exports=nLe});var I3=s(function(hYe,W3){"use strict";var aLe=require("debug"),sLe=aLe("random:streams:cosine");W3.exports=sLe});var Bf=s(function(pYe,C3){"use strict";var U3=require("readable-stream").Readable,uLe=require("@stdlib/assert/is-positive-number").isPrimitive,oLe=require("@stdlib/assert/is-number").isPrimitive,gLe=require("@stdlib/math/base/assert/is-nan"),vLe=require("@stdlib/assert/is-error"),fLe=require("@stdlib/object/assign"),dLe=require("@stdlib/utils/inherit"),z3=require("@stdlib/utils/define-nonenumerable-property"),wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cf=require("@stdlib/utils/define-read-only-accessor"),lLe=require("@stdlib/utils/define-read-write-accessor"),cLe=an().factory,k3=require("@stdlib/buffer/from-string"),mLe=require("@stdlib/utils/next-tick"),J3=require("@stdlib/string/format"),hLe=G3(),pLe=F3(),Va=I3();function yLe(){return this._prng.seed}function qLe(){return this._prng.seedLength}function bLe(){return this._prng.stateLength}function wLe(){return this._prng.byteLength}function SLe(){return this._prng.state}function OLe(r){this._prng.state=r}function NLe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Va("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Va("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=k3(e):e=k3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function ELe(r){var e;if(this._destroyed)return Va("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,mLe(i),this;function i(){r&&(Va("Stream was destroyed due to an error. Error: %s.",vLe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Va("Closing the stream..."),e.emit("close")}}function ge(r,e,i){var t,n;if(!(this instanceof ge))return arguments.length>2?new ge(r,e,i):new ge(r,e);if(!oLe(r)||gLe(r))throw new TypeError(J3("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!uLe(e))throw new TypeError(J3("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=fLe({},hLe),arguments.length>2&&(n=pLe(t,i),n))throw n;return Va("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),U3.call(this,t),z3(this,"_destroyed",!1),wi(this,"_objectMode",t.objectMode),wi(this,"_sep",t.sep),wi(this,"_iter",t.iter),wi(this,"_siter",t.siter),z3(this,"_i",0),wi(this,"_prng",cLe(r,e,t)),wi(this,"PRNG",this._prng.PRNG),this}dLe(ge,U3);Cf(ge.prototype,"seed",yLe);Cf(ge.prototype,"seedLength",qLe);lLe(ge.prototype,"state",SLe,OLe);Cf(ge.prototype,"stateLength",bLe);Cf(ge.prototype,"byteLength",wLe);wi(ge.prototype,"_read",NLe);wi(ge.prototype,"destroy",ELe);C3.exports=ge});var X3=s(function(yYe,B3){"use strict";var LLe=require("@stdlib/assert/is-plain-object"),RLe=require("@stdlib/object/assign"),PLe=require("@stdlib/string/format"),_Le=Bf();function TLe(r,e,i){var t;if(arguments.length>2){if(t=i,!LLe(t))throw new TypeError(PLe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=RLe({},i)}else t={};return t.objectMode=!0,new _Le(r,e,t)}B3.exports=TLe});var $3=s(function(qYe,Q3){"use strict";var D3=require("@stdlib/assert/is-plain-object"),Y3=require("@stdlib/object/assign"),H3=require("@stdlib/string/format"),Z3=Bf();function jLe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!D3(r))throw new TypeError(H3("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Y3({},r)}else if(t>2){if(!D3(i))throw new TypeError(H3("invalid argument. Options argument must be an object. Value: `%s`.",i));n=Y3({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new Z3(g,f,n)}function o(){return new Z3(r,e,n)}}Q3.exports=jLe});var rJ=s(function(bYe,eJ){"use strict";var K3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Um=Bf(),MLe=X3(),xLe=$3();K3(Um,"objectMode",MLe);K3(Um,"factory",xLe);eJ.exports=Um});var tJ=s(function(wYe,GLe){GLe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var aJ=s(function(SYe,nJ){"use strict";var ALe=require("@stdlib/assert/is-plain-object"),tr=require("@stdlib/assert/has-own-property"),VLe=require("@stdlib/assert/is-boolean").isPrimitive,FLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,iJ=require("@stdlib/assert/is-string").isPrimitive,WLe=require("@stdlib/assert/is-positive-integer").isPrimitive,ILe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,On=require("@stdlib/string/format");function zLe(r,e){return ALe(e)?tr(e,"sep")&&(r.sep=e.sep,!iJ(r.sep))?new TypeError(On("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):tr(e,"objectMode")&&(r.objectMode=e.objectMode,!VLe(r.objectMode))?new TypeError(On("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):tr(e,"encoding")&&(r.encoding=e.encoding,!iJ(r.encoding)&&r.encoding!==null)?new TypeError(On("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!FLe(r.highWaterMark))?new TypeError(On("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):tr(e,"iter")&&(r.iter=e.iter,!ILe(r.iter))?new TypeError(On("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):tr(e,"siter")&&(r.siter=e.siter,!WLe(r.siter))?new TypeError(On("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(tr(e,"prng")&&(r.prng=e.prng),tr(e,"seed")&&(r.seed=e.seed),tr(e,"state")&&(r.state=e.state),tr(e,"copy")&&(r.copy=e.copy),null):new TypeError(On("invalid argument. Options argument must be an object. Value: `%s`.",e))}nJ.exports=zLe});var uJ=s(function(OYe,sJ){"use strict";var kLe=require("debug"),JLe=kLe("random:streams:discrete-uniform");sJ.exports=JLe});var Df=s(function(NYe,dJ){"use strict";var fJ=require("readable-stream").Readable,oJ=require("@stdlib/assert/is-integer").isPrimitive,ULe=require("@stdlib/assert/is-error"),CLe=require("@stdlib/object/assign"),BLe=require("@stdlib/utils/inherit"),gJ=require("@stdlib/utils/define-nonenumerable-property"),Si=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xf=require("@stdlib/utils/define-read-only-accessor"),XLe=require("@stdlib/utils/define-read-write-accessor"),DLe=sn().factory,vJ=require("@stdlib/buffer/from-string"),YLe=require("@stdlib/utils/next-tick"),Cm=require("@stdlib/string/format"),HLe=tJ(),ZLe=aJ(),Fa=uJ();function QLe(){return this._prng.seed}function $Le(){return this._prng.seedLength}function KLe(){return this._prng.stateLength}function eRe(){return this._prng.byteLength}function rRe(){return this._prng.state}function tRe(r){this._prng.state=r}function iRe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Fa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Fa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=vJ(e):e=vJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nRe(r){var e;if(this._destroyed)return Fa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,YLe(i),this;function i(){r&&(Fa("Stream was destroyed due to an error. Error: %s.",ULe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Fa("Closing the stream..."),e.emit("close")}}function ve(r,e,i){var t,n;if(!(this instanceof ve))return arguments.length>2?new ve(r,e,i):new ve(r,e);if(!oJ(r))throw new TypeError(Cm("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!oJ(e))throw new TypeError(Cm("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(Cm("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e));if(t=CLe({},HLe),arguments.length>2&&(n=ZLe(t,i),n))throw n;return Fa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),fJ.call(this,t),gJ(this,"_destroyed",!1),Si(this,"_objectMode",t.objectMode),Si(this,"_sep",t.sep),Si(this,"_iter",t.iter),Si(this,"_siter",t.siter),gJ(this,"_i",0),Si(this,"_prng",DLe(r,e,t)),Si(this,"PRNG",this._prng.PRNG),this}BLe(ve,fJ);Xf(ve.prototype,"seed",QLe);Xf(ve.prototype,"seedLength",$Le);XLe(ve.prototype,"state",rRe,tRe);Xf(ve.prototype,"stateLength",KLe);Xf(ve.prototype,"byteLength",eRe);Si(ve.prototype,"_read",iRe);Si(ve.prototype,"destroy",nRe);dJ.exports=ve});var cJ=s(function(EYe,lJ){"use strict";var aRe=require("@stdlib/assert/is-plain-object"),sRe=require("@stdlib/object/assign"),uRe=require("@stdlib/string/format"),oRe=Df();function gRe(r,e,i){var t;if(arguments.length>2){if(t=i,!aRe(t))throw new TypeError(uRe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=sRe({},i)}else t={};return t.objectMode=!0,new oRe(r,e,t)}lJ.exports=gRe});var bJ=s(function(LYe,qJ){"use strict";var mJ=require("@stdlib/assert/is-plain-object"),hJ=require("@stdlib/object/assign"),pJ=require("@stdlib/string/format"),yJ=Df();function vRe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!mJ(r))throw new TypeError(pJ("invalid argument. Options argument must be an object. Value: `%s`.",r));n=hJ({},r)}else if(t>2){if(!mJ(i))throw new TypeError(pJ("invalid argument. Options argument must be an object. Value: `%s`.",i));n=hJ({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new yJ(g,f,n)}function o(){return new yJ(r,e,n)}}qJ.exports=vRe});var OJ=s(function(RYe,SJ){"use strict";var wJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bm=Df(),fRe=cJ(),dRe=bJ();wJ(Bm,"objectMode",fRe);wJ(Bm,"factory",dRe);SJ.exports=Bm});var NJ=s(function(PYe,lRe){lRe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var RJ=s(function(_Ye,LJ){"use strict";var cRe=require("@stdlib/assert/is-plain-object"),ir=require("@stdlib/assert/has-own-property"),mRe=require("@stdlib/assert/is-boolean").isPrimitive,hRe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,EJ=require("@stdlib/assert/is-string").isPrimitive,pRe=require("@stdlib/assert/is-positive-integer").isPrimitive,yRe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nn=require("@stdlib/string/format");function qRe(r,e){return cRe(e)?ir(e,"sep")&&(r.sep=e.sep,!EJ(r.sep))?new TypeError(Nn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ir(e,"objectMode")&&(r.objectMode=e.objectMode,!mRe(r.objectMode))?new TypeError(Nn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ir(e,"encoding")&&(r.encoding=e.encoding,!EJ(r.encoding)&&r.encoding!==null)?new TypeError(Nn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ir(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!hRe(r.highWaterMark))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ir(e,"iter")&&(r.iter=e.iter,!yRe(r.iter))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ir(e,"siter")&&(r.siter=e.siter,!pRe(r.siter))?new TypeError(Nn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ir(e,"prng")&&(r.prng=e.prng),ir(e,"seed")&&(r.seed=e.seed),ir(e,"state")&&(r.state=e.state),ir(e,"copy")&&(r.copy=e.copy),null):new TypeError(Nn("invalid argument. Options argument must be an object. Value: `%s`.",e))}LJ.exports=qRe});var _J=s(function(TYe,PJ){"use strict";var bRe=require("debug"),wRe=bRe("random:streams:erlang");PJ.exports=wRe});var Hf=s(function(jYe,GJ){"use strict";var xJ=require("readable-stream").Readable,SRe=require("@stdlib/assert/is-positive-integer").isPrimitive,ORe=require("@stdlib/assert/is-positive-number").isPrimitive,NRe=require("@stdlib/assert/is-error"),ERe=require("@stdlib/object/assign"),LRe=require("@stdlib/utils/inherit"),TJ=require("@stdlib/utils/define-nonenumerable-property"),Oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yf=require("@stdlib/utils/define-read-only-accessor"),RRe=require("@stdlib/utils/define-read-write-accessor"),PRe=Qs().factory,jJ=require("@stdlib/buffer/from-string"),_Re=require("@stdlib/utils/next-tick"),MJ=require("@stdlib/string/format"),TRe=NJ(),jRe=RJ(),Wa=_J();function MRe(){return this._prng.seed}function xRe(){return this._prng.seedLength}function GRe(){return this._prng.stateLength}function ARe(){return this._prng.byteLength}function VRe(){return this._prng.state}function FRe(r){this._prng.state=r}function WRe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Wa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Wa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=jJ(e):e=jJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function IRe(r){var e;if(this._destroyed)return Wa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,_Re(i),this;function i(){r&&(Wa("Stream was destroyed due to an error. Error: %s.",NRe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Wa("Closing the stream..."),e.emit("close")}}function fe(r,e,i){var t,n;if(!(this instanceof fe))return arguments.length>2?new fe(r,e,i):new fe(r,e);if(!SRe(r))throw new TypeError(MJ("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!ORe(e))throw new TypeError(MJ("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=ERe({},TRe),arguments.length>2&&(n=jRe(t,i),n))throw n;return Wa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),xJ.call(this,t),TJ(this,"_destroyed",!1),Oi(this,"_objectMode",t.objectMode),Oi(this,"_sep",t.sep),Oi(this,"_iter",t.iter),Oi(this,"_siter",t.siter),TJ(this,"_i",0),Oi(this,"_prng",PRe(r,e,t)),Oi(this,"PRNG",this._prng.PRNG),this}LRe(fe,xJ);Yf(fe.prototype,"seed",MRe);Yf(fe.prototype,"seedLength",xRe);RRe(fe.prototype,"state",VRe,FRe);Yf(fe.prototype,"stateLength",GRe);Yf(fe.prototype,"byteLength",ARe);Oi(fe.prototype,"_read",WRe);Oi(fe.prototype,"destroy",IRe);GJ.exports=fe});var VJ=s(function(MYe,AJ){"use strict";var zRe=require("@stdlib/assert/is-plain-object"),kRe=require("@stdlib/object/assign"),JRe=require("@stdlib/string/format"),URe=Hf();function CRe(r,e,i){var t;if(arguments.length>2){if(t=i,!zRe(t))throw new TypeError(JRe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=kRe({},i)}else t={};return t.objectMode=!0,new URe(r,e,t)}AJ.exports=CRe});var JJ=s(function(xYe,kJ){"use strict";var FJ=require("@stdlib/assert/is-plain-object"),WJ=require("@stdlib/object/assign"),IJ=require("@stdlib/string/format"),zJ=Hf();function BRe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!FJ(r))throw new TypeError(IJ("invalid argument. Options argument must be an object. Value: `%s`.",r));n=WJ({},r)}else if(t>2){if(!FJ(i))throw new TypeError(IJ("invalid argument. Options argument must be an object. Value: `%s`.",i));n=WJ({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new zJ(g,f,n)}function o(){return new zJ(r,e,n)}}kJ.exports=BRe});var BJ=s(function(GYe,CJ){"use strict";var UJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xm=Hf(),XRe=VJ(),DRe=JJ();UJ(Xm,"objectMode",XRe);UJ(Xm,"factory",DRe);CJ.exports=Xm});var XJ=s(function(AYe,YRe){YRe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var HJ=s(function(VYe,YJ){"use strict";var HRe=require("@stdlib/assert/is-plain-object"),nr=require("@stdlib/assert/has-own-property"),ZRe=require("@stdlib/assert/is-boolean").isPrimitive,QRe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,DJ=require("@stdlib/assert/is-string").isPrimitive,$Re=require("@stdlib/assert/is-positive-integer").isPrimitive,KRe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,En=require("@stdlib/string/format");function ePe(r,e){return HRe(e)?nr(e,"sep")&&(r.sep=e.sep,!DJ(r.sep))?new TypeError(En("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):nr(e,"objectMode")&&(r.objectMode=e.objectMode,!ZRe(r.objectMode))?new TypeError(En("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):nr(e,"encoding")&&(r.encoding=e.encoding,!DJ(r.encoding)&&r.encoding!==null)?new TypeError(En("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!QRe(r.highWaterMark))?new TypeError(En("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):nr(e,"iter")&&(r.iter=e.iter,!KRe(r.iter))?new TypeError(En("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):nr(e,"siter")&&(r.siter=e.siter,!$Re(r.siter))?new TypeError(En("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(nr(e,"prng")&&(r.prng=e.prng),nr(e,"seed")&&(r.seed=e.seed),nr(e,"state")&&(r.state=e.state),nr(e,"copy")&&(r.copy=e.copy),null):new TypeError(En("invalid argument. Options argument must be an object. Value: `%s`.",e))}YJ.exports=ePe});var QJ=s(function(FYe,ZJ){"use strict";var rPe=require("debug"),tPe=rPe("random:streams:exponential");ZJ.exports=tPe});var Qf=s(function(WYe,rU){"use strict";var eU=require("readable-stream").Readable,iPe=require("@stdlib/assert/is-positive-number").isPrimitive,nPe=require("@stdlib/assert/is-error"),aPe=require("@stdlib/object/assign"),sPe=require("@stdlib/utils/inherit"),$J=require("@stdlib/utils/define-nonenumerable-property"),Ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zf=require("@stdlib/utils/define-read-only-accessor"),uPe=require("@stdlib/utils/define-read-write-accessor"),oPe=un().factory,KJ=require("@stdlib/buffer/from-string"),gPe=require("@stdlib/utils/next-tick"),vPe=require("@stdlib/string/format"),fPe=XJ(),dPe=HJ(),Ia=QJ();function lPe(){return this._prng.seed}function cPe(){return this._prng.seedLength}function mPe(){return this._prng.stateLength}function hPe(){return this._prng.byteLength}function pPe(){return this._prng.state}function yPe(r){this._prng.state=r}function qPe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ia("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ia("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=KJ(e):e=KJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function bPe(r){var e;if(this._destroyed)return Ia("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,gPe(i),this;function i(){r&&(Ia("Stream was destroyed due to an error. Error: %s.",nPe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ia("Closing the stream..."),e.emit("close")}}function de(r,e){var i,t;if(!(this instanceof de))return arguments.length>1?new de(r,e):new de(r);if(!iPe(r))throw new TypeError(vPe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=aPe({},fPe),arguments.length>1&&(t=dPe(i,e),t))throw t;return Ia("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),eU.call(this,i),$J(this,"_destroyed",!1),Ni(this,"_objectMode",i.objectMode),Ni(this,"_sep",i.sep),Ni(this,"_iter",i.iter),Ni(this,"_siter",i.siter),$J(this,"_i",0),Ni(this,"_prng",oPe(r,i)),Ni(this,"PRNG",this._prng.PRNG),this}sPe(de,eU);Zf(de.prototype,"seed",lPe);Zf(de.prototype,"seedLength",cPe);uPe(de.prototype,"state",pPe,yPe);Zf(de.prototype,"stateLength",mPe);Zf(de.prototype,"byteLength",hPe);Ni(de.prototype,"_read",qPe);Ni(de.prototype,"destroy",bPe);rU.exports=de});var iU=s(function(IYe,tU){"use strict";var wPe=require("@stdlib/assert/is-plain-object"),SPe=require("@stdlib/object/assign"),OPe=require("@stdlib/string/format"),NPe=Qf();function EPe(r,e){var i;if(arguments.length>1){if(i=e,!wPe(i))throw new TypeError(OPe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=SPe({},e)}else i={};return i.objectMode=!0,new NPe(r,i)}tU.exports=EPe});var gU=s(function(zYe,oU){"use strict";var LPe=require("@stdlib/assert/is-positive-number").isPrimitive,nU=require("@stdlib/assert/is-plain-object"),aU=require("@stdlib/object/assign"),sU=require("@stdlib/string/format"),uU=Qf();function RPe(r,e){var i,t,n;if(i=arguments.length,i>1){if(!nU(e))throw new TypeError(sU("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=aU({},e)}else if(i===1)if(LPe(r))n=u,t={};else{if(!nU(r))throw new TypeError(sU("invalid argument. Options argument must be an object. Value: `%s`.",r));t=aU({},r),n=a}else t={},n=a;return n;function a(o){return new uU(o,t)}function u(){return new uU(r,t)}}oU.exports=RPe});var dU=s(function(kYe,fU){"use strict";var vU=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dm=Qf(),PPe=iU(),_Pe=gU();vU(Dm,"objectMode",PPe);vU(Dm,"factory",_Pe);fU.exports=Dm});var lU=s(function(JYe,TPe){TPe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var hU=s(function(UYe,mU){"use strict";var jPe=require("@stdlib/assert/is-plain-object"),ar=require("@stdlib/assert/has-own-property"),MPe=require("@stdlib/assert/is-boolean").isPrimitive,xPe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,cU=require("@stdlib/assert/is-string").isPrimitive,GPe=require("@stdlib/assert/is-positive-integer").isPrimitive,APe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ln=require("@stdlib/string/format");function VPe(r,e){return jPe(e)?ar(e,"sep")&&(r.sep=e.sep,!cU(r.sep))?new TypeError(Ln("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ar(e,"objectMode")&&(r.objectMode=e.objectMode,!MPe(r.objectMode))?new TypeError(Ln("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ar(e,"encoding")&&(r.encoding=e.encoding,!cU(r.encoding)&&r.encoding!==null)?new TypeError(Ln("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ar(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!xPe(r.highWaterMark))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ar(e,"iter")&&(r.iter=e.iter,!APe(r.iter))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ar(e,"siter")&&(r.siter=e.siter,!GPe(r.siter))?new TypeError(Ln("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ar(e,"prng")&&(r.prng=e.prng),ar(e,"seed")&&(r.seed=e.seed),ar(e,"state")&&(r.state=e.state),ar(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ln("invalid argument. Options argument must be an object. Value: `%s`.",e))}mU.exports=VPe});var yU=s(function(CYe,pU){"use strict";var FPe=require("debug"),WPe=FPe("random:streams:f");pU.exports=WPe});var Kf=s(function(BYe,NU){"use strict";var OU=require("readable-stream").Readable,qU=require("@stdlib/assert/is-positive-number").isPrimitive,IPe=require("@stdlib/assert/is-error"),zPe=require("@stdlib/object/assign"),kPe=require("@stdlib/utils/inherit"),bU=require("@stdlib/utils/define-nonenumerable-property"),Ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),$f=require("@stdlib/utils/define-read-only-accessor"),JPe=require("@stdlib/utils/define-read-write-accessor"),UPe=$s().factory,wU=require("@stdlib/buffer/from-string"),CPe=require("@stdlib/utils/next-tick"),SU=require("@stdlib/string/format"),BPe=lU(),XPe=hU(),za=yU();function DPe(){return this._prng.seed}function YPe(){return this._prng.seedLength}function HPe(){return this._prng.stateLength}function ZPe(){return this._prng.byteLength}function QPe(){return this._prng.state}function $Pe(r){this._prng.state=r}function KPe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return za("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),za("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=wU(e):e=wU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function e_e(r){var e;if(this._destroyed)return za("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,CPe(i),this;function i(){r&&(za("Stream was destroyed due to an error. Error: %s.",IPe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),za("Closing the stream..."),e.emit("close")}}function le(r,e,i){var t,n;if(!(this instanceof le))return arguments.length>2?new le(r,e,i):new le(r,e);if(!qU(r))throw new TypeError(SU("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!qU(e))throw new TypeError(SU("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=zPe({},BPe),arguments.length>2&&(n=XPe(t,i),n))throw n;return za("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),OU.call(this,t),bU(this,"_destroyed",!1),Ei(this,"_objectMode",t.objectMode),Ei(this,"_sep",t.sep),Ei(this,"_iter",t.iter),Ei(this,"_siter",t.siter),bU(this,"_i",0),Ei(this,"_prng",UPe(r,e,t)),Ei(this,"PRNG",this._prng.PRNG),this}kPe(le,OU);$f(le.prototype,"seed",DPe);$f(le.prototype,"seedLength",YPe);JPe(le.prototype,"state",QPe,$Pe);$f(le.prototype,"stateLength",HPe);$f(le.prototype,"byteLength",ZPe);Ei(le.prototype,"_read",KPe);Ei(le.prototype,"destroy",e_e);NU.exports=le});var LU=s(function(XYe,EU){"use strict";var r_e=require("@stdlib/assert/is-plain-object"),t_e=require("@stdlib/object/assign"),i_e=require("@stdlib/string/format"),n_e=Kf();function a_e(r,e,i){var t;if(arguments.length>2){if(t=i,!r_e(t))throw new TypeError(i_e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=t_e({},i)}else t={};return t.objectMode=!0,new n_e(r,e,t)}EU.exports=a_e});var MU=s(function(DYe,jU){"use strict";var RU=require("@stdlib/assert/is-plain-object"),PU=require("@stdlib/object/assign"),_U=require("@stdlib/string/format"),TU=Kf();function s_e(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!RU(r))throw new TypeError(_U("invalid argument. Options argument must be an object. Value: `%s`.",r));n=PU({},r)}else if(t>2){if(!RU(i))throw new TypeError(_U("invalid argument. Options argument must be an object. Value: `%s`.",i));n=PU({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new TU(g,f,n)}function o(){return new TU(r,e,n)}}jU.exports=s_e});var AU=s(function(YYe,GU){"use strict";var xU=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ym=Kf(),u_e=LU(),o_e=MU();xU(Ym,"objectMode",u_e);xU(Ym,"factory",o_e);GU.exports=Ym});var VU=s(function(HYe,g_e){g_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var IU=s(function(ZYe,WU){"use strict";var v_e=require("@stdlib/assert/is-plain-object"),sr=require("@stdlib/assert/has-own-property"),f_e=require("@stdlib/assert/is-boolean").isPrimitive,d_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,FU=require("@stdlib/assert/is-string").isPrimitive,l_e=require("@stdlib/assert/is-positive-integer").isPrimitive,c_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rn=require("@stdlib/string/format");function m_e(r,e){return v_e(e)?sr(e,"sep")&&(r.sep=e.sep,!FU(r.sep))?new TypeError(Rn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):sr(e,"objectMode")&&(r.objectMode=e.objectMode,!f_e(r.objectMode))?new TypeError(Rn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):sr(e,"encoding")&&(r.encoding=e.encoding,!FU(r.encoding)&&r.encoding!==null)?new TypeError(Rn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):sr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!d_e(r.highWaterMark))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):sr(e,"iter")&&(r.iter=e.iter,!c_e(r.iter))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):sr(e,"siter")&&(r.siter=e.siter,!l_e(r.siter))?new TypeError(Rn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(sr(e,"prng")&&(r.prng=e.prng),sr(e,"seed")&&(r.seed=e.seed),sr(e,"state")&&(r.state=e.state),sr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Rn("invalid argument. Options argument must be an object. Value: `%s`.",e))}WU.exports=m_e});var kU=s(function(QYe,zU){"use strict";var h_e=require("debug"),p_e=h_e("random:streams:frechet");zU.exports=p_e});var rd=s(function($Ye,XU){"use strict";var BU=require("readable-stream").Readable,JU=require("@stdlib/assert/is-positive-number"),y_e=require("@stdlib/assert/is-number").isPrimitive,q_e=require("@stdlib/math/base/assert/is-nan"),b_e=require("@stdlib/assert/is-error"),w_e=require("@stdlib/object/assign"),S_e=require("@stdlib/utils/inherit"),UU=require("@stdlib/utils/define-nonenumerable-property"),Li=require("@stdlib/utils/define-nonenumerable-read-only-property"),ed=require("@stdlib/utils/define-read-only-accessor"),O_e=require("@stdlib/utils/define-read-write-accessor"),N_e=Ks().factory,CU=require("@stdlib/buffer/from-string"),E_e=require("@stdlib/utils/next-tick"),Hm=require("@stdlib/string/format"),L_e=VU(),R_e=IU(),ka=kU();function P_e(){return this._prng.seed}function __e(){return this._prng.seedLength}function T_e(){return this._prng.stateLength}function j_e(){return this._prng.byteLength}function M_e(){return this._prng.state}function x_e(r){this._prng.state=r}function G_e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ka("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ka("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=CU(e):e=CU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function A_e(r){var e;if(this._destroyed)return ka("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,E_e(i),this;function i(){r&&(ka("Stream was destroyed due to an error. Error: %s.",b_e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ka("Closing the stream..."),e.emit("close")}}function ce(r,e,i,t){var n,a;if(!(this instanceof ce))return arguments.length>3?new ce(r,e,i,t):new ce(r,e,i);if(!JU(r))throw new TypeError(Hm("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r));if(!JU(e))throw new TypeError(Hm("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e));if(!y_e(i)||q_e(i))throw new TypeError(Hm("invalid argument. Third argument must be a number. Value: `%s`.",i));if(n=w_e({},L_e),arguments.length>3&&(a=R_e(n,t),a))throw a;return ka("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),BU.call(this,n),UU(this,"_destroyed",!1),Li(this,"_objectMode",n.objectMode),Li(this,"_sep",n.sep),Li(this,"_iter",n.iter),Li(this,"_siter",n.siter),UU(this,"_i",0),Li(this,"_prng",N_e(r,e,i,n)),Li(this,"PRNG",this._prng.PRNG),this}S_e(ce,BU);ed(ce.prototype,"seed",P_e);ed(ce.prototype,"seedLength",__e);O_e(ce.prototype,"state",M_e,x_e);ed(ce.prototype,"stateLength",T_e);ed(ce.prototype,"byteLength",j_e);Li(ce.prototype,"_read",G_e);Li(ce.prototype,"destroy",A_e);XU.exports=ce});var YU=s(function(KYe,DU){"use strict";var V_e=require("@stdlib/assert/is-plain-object"),F_e=require("@stdlib/object/assign"),W_e=require("@stdlib/string/format"),I_e=rd();function z_e(r,e,i,t){var n;if(arguments.length>3){if(n=t,!V_e(n))throw new TypeError(W_e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=F_e({},t)}else n={};return n.objectMode=!0,new I_e(r,e,i,n)}DU.exports=z_e});var eC=s(function(eHe,KU){"use strict";var HU=require("@stdlib/assert/is-plain-object"),ZU=require("@stdlib/object/assign"),QU=require("@stdlib/string/format"),$U=rd();function k_e(r,e,i,t){var n,a,u;if(n=arguments.length,n===1){if(!HU(r))throw new TypeError(QU("invalid argument. Options argument must be an object. Value: `%s`.",r));a=ZU({},r)}else if(n>3){if(!HU(t))throw new TypeError(QU("invalid argument. Options argument must be an object. Value: `%s`.",t));a=ZU({},t)}else a={};return n<3?u=o:u=g,u;function o(f,m,c){return new $U(f,m,c,a)}function g(){return new $U(r,e,i,a)}}KU.exports=k_e});var iC=s(function(rHe,tC){"use strict";var rC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zm=rd(),J_e=YU(),U_e=eC();rC(Zm,"objectMode",J_e);rC(Zm,"factory",U_e);tC.exports=Zm});var nC=s(function(tHe,C_e){C_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var uC=s(function(iHe,sC){"use strict";var B_e=require("@stdlib/assert/is-plain-object"),ur=require("@stdlib/assert/has-own-property"),X_e=require("@stdlib/assert/is-boolean").isPrimitive,D_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,aC=require("@stdlib/assert/is-string").isPrimitive,Y_e=require("@stdlib/assert/is-positive-integer").isPrimitive,H_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Pn=require("@stdlib/string/format");function Z_e(r,e){return B_e(e)?ur(e,"sep")&&(r.sep=e.sep,!aC(r.sep))?new TypeError(Pn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ur(e,"objectMode")&&(r.objectMode=e.objectMode,!X_e(r.objectMode))?new TypeError(Pn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ur(e,"encoding")&&(r.encoding=e.encoding,!aC(r.encoding)&&r.encoding!==null)?new TypeError(Pn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ur(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!D_e(r.highWaterMark))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ur(e,"iter")&&(r.iter=e.iter,!H_e(r.iter))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ur(e,"siter")&&(r.siter=e.siter,!Y_e(r.siter))?new TypeError(Pn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ur(e,"prng")&&(r.prng=e.prng),ur(e,"seed")&&(r.seed=e.seed),ur(e,"state")&&(r.state=e.state),ur(e,"copy")&&(r.copy=e.copy),null):new TypeError(Pn("invalid argument. Options argument must be an object. Value: `%s`.",e))}sC.exports=Z_e});var gC=s(function(nHe,oC){"use strict";var Q_e=require("debug"),$_e=Q_e("random:streams:gamma");oC.exports=$_e});var id=s(function(aHe,mC){"use strict";var cC=require("readable-stream").Readable,vC=require("@stdlib/assert/is-positive-number").isPrimitive,K_e=require("@stdlib/assert/is-error"),eTe=require("@stdlib/object/assign"),rTe=require("@stdlib/utils/inherit"),fC=require("@stdlib/utils/define-nonenumerable-property"),Ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),td=require("@stdlib/utils/define-read-only-accessor"),tTe=require("@stdlib/utils/define-read-write-accessor"),iTe=ke().factory,dC=require("@stdlib/buffer/from-string"),nTe=require("@stdlib/utils/next-tick"),lC=require("@stdlib/string/format"),aTe=nC(),sTe=uC(),Ja=gC();function uTe(){return this._prng.seed}function oTe(){return this._prng.seedLength}function gTe(){return this._prng.stateLength}function vTe(){return this._prng.byteLength}function fTe(){return this._prng.state}function dTe(r){this._prng.state=r}function lTe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ja("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ja("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=dC(e):e=dC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function cTe(r){var e;if(this._destroyed)return Ja("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,nTe(i),this;function i(){r&&(Ja("Stream was destroyed due to an error. Error: %s.",K_e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ja("Closing the stream..."),e.emit("close")}}function me(r,e,i){var t,n;if(!(this instanceof me))return arguments.length>2?new me(r,e,i):new me(r,e);if(!vC(r))throw new TypeError(lC("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!vC(e))throw new TypeError(lC("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=eTe({},aTe),arguments.length>2&&(n=sTe(t,i),n))throw n;return Ja("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),cC.call(this,t),fC(this,"_destroyed",!1),Ri(this,"_objectMode",t.objectMode),Ri(this,"_sep",t.sep),Ri(this,"_iter",t.iter),Ri(this,"_siter",t.siter),fC(this,"_i",0),Ri(this,"_prng",iTe(r,e,t)),Ri(this,"PRNG",this._prng.PRNG),this}rTe(me,cC);td(me.prototype,"seed",uTe);td(me.prototype,"seedLength",oTe);tTe(me.prototype,"state",fTe,dTe);td(me.prototype,"stateLength",gTe);td(me.prototype,"byteLength",vTe);Ri(me.prototype,"_read",lTe);Ri(me.prototype,"destroy",cTe);mC.exports=me});var pC=s(function(sHe,hC){"use strict";var mTe=require("@stdlib/assert/is-plain-object"),hTe=require("@stdlib/object/assign"),pTe=require("@stdlib/string/format"),yTe=id();function qTe(r,e,i){var t;if(arguments.length>2){if(t=i,!mTe(t))throw new TypeError(pTe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=hTe({},i)}else t={};return t.objectMode=!0,new yTe(r,e,t)}hC.exports=qTe});var OC=s(function(uHe,SC){"use strict";var yC=require("@stdlib/assert/is-plain-object"),qC=require("@stdlib/object/assign"),bC=require("@stdlib/string/format"),wC=id();function bTe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!yC(r))throw new TypeError(bC("invalid argument. Options argument must be an object. Value: `%s`.",r));n=qC({},r)}else if(t>2){if(!yC(i))throw new TypeError(bC("invalid argument. Options argument must be an object. Value: `%s`.",i));n=qC({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new wC(g,f,n)}function o(){return new wC(r,e,n)}}SC.exports=bTe});var LC=s(function(oHe,EC){"use strict";var NC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qm=id(),wTe=pC(),STe=OC();NC(Qm,"objectMode",wTe);NC(Qm,"factory",STe);EC.exports=Qm});var RC=s(function(gHe,OTe){OTe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var TC=s(function(vHe,_C){"use strict";var NTe=require("@stdlib/assert/is-plain-object"),or=require("@stdlib/assert/has-own-property"),ETe=require("@stdlib/assert/is-boolean").isPrimitive,LTe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,PC=require("@stdlib/assert/is-string").isPrimitive,RTe=require("@stdlib/assert/is-positive-integer").isPrimitive,PTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_n=require("@stdlib/string/format");function _Te(r,e){return NTe(e)?or(e,"sep")&&(r.sep=e.sep,!PC(r.sep))?new TypeError(_n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):or(e,"objectMode")&&(r.objectMode=e.objectMode,!ETe(r.objectMode))?new TypeError(_n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):or(e,"encoding")&&(r.encoding=e.encoding,!PC(r.encoding)&&r.encoding!==null)?new TypeError(_n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!LTe(r.highWaterMark))?new TypeError(_n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):or(e,"iter")&&(r.iter=e.iter,!PTe(r.iter))?new TypeError(_n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):or(e,"siter")&&(r.siter=e.siter,!RTe(r.siter))?new TypeError(_n("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(or(e,"prng")&&(r.prng=e.prng),or(e,"seed")&&(r.seed=e.seed),or(e,"state")&&(r.state=e.state),or(e,"copy")&&(r.copy=e.copy),null):new TypeError(_n("invalid argument. Options argument must be an object. Value: `%s`.",e))}_C.exports=_Te});var MC=s(function(fHe,jC){"use strict";var TTe=require("debug"),jTe=TTe("random:streams:geometric");jC.exports=jTe});var ad=s(function(dHe,VC){"use strict";var AC=require("readable-stream").Readable,MTe=require("@stdlib/assert/is-probability").isPrimitive,xTe=require("@stdlib/assert/is-error"),GTe=require("@stdlib/object/assign"),ATe=require("@stdlib/utils/inherit"),xC=require("@stdlib/utils/define-nonenumerable-property"),Pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),nd=require("@stdlib/utils/define-read-only-accessor"),VTe=require("@stdlib/utils/define-read-write-accessor"),FTe=ua().factory,GC=require("@stdlib/buffer/from-string"),WTe=require("@stdlib/utils/next-tick"),ITe=require("@stdlib/string/format"),zTe=RC(),kTe=TC(),Ua=MC();function JTe(){return this._prng.seed}function UTe(){return this._prng.seedLength}function CTe(){return this._prng.stateLength}function BTe(){return this._prng.byteLength}function XTe(){return this._prng.state}function DTe(r){this._prng.state=r}function YTe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ua("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ua("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=GC(e):e=GC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function HTe(r){var e;if(this._destroyed)return Ua("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,WTe(i),this;function i(){r&&(Ua("Stream was destroyed due to an error. Error: %s.",xTe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ua("Closing the stream..."),e.emit("close")}}function he(r,e){var i,t;if(!(this instanceof he))return arguments.length>1?new he(r,e):new he(r);if(!MTe(r))throw new TypeError(ITe("invalid argument. First argument must be a probability. Value: `%s`.",r));if(i=GTe({},zTe),arguments.length>1&&(t=kTe(i,e),t))throw t;return Ua("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),AC.call(this,i),xC(this,"_destroyed",!1),Pi(this,"_objectMode",i.objectMode),Pi(this,"_sep",i.sep),Pi(this,"_iter",i.iter),Pi(this,"_siter",i.siter),xC(this,"_i",0),Pi(this,"_prng",FTe(r,i)),Pi(this,"PRNG",this._prng.PRNG),this}ATe(he,AC);nd(he.prototype,"seed",JTe);nd(he.prototype,"seedLength",UTe);VTe(he.prototype,"state",XTe,DTe);nd(he.prototype,"stateLength",CTe);nd(he.prototype,"byteLength",BTe);Pi(he.prototype,"_read",YTe);Pi(he.prototype,"destroy",HTe);VC.exports=he});var WC=s(function(lHe,FC){"use strict";var ZTe=require("@stdlib/assert/is-plain-object"),QTe=require("@stdlib/object/assign"),$Te=require("@stdlib/string/format"),KTe=ad();function e0e(r,e){var i;if(arguments.length>1){if(i=e,!ZTe(i))throw new TypeError($Te("invalid argument. Options argument must be an object. Value: `%s`.",i));i=QTe({},e)}else i={};return i.objectMode=!0,new KTe(r,i)}FC.exports=e0e});var CC=s(function(cHe,UC){"use strict";var r0e=require("@stdlib/assert/is-probability").isPrimitive,IC=require("@stdlib/assert/is-plain-object"),zC=require("@stdlib/object/assign"),kC=require("@stdlib/string/format"),JC=ad();function t0e(r,e){var i,t,n;if(i=arguments.length,i>1){if(!IC(e))throw new TypeError(kC("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=zC({},e)}else if(i===1)if(r0e(r))n=u,t={};else{if(!IC(r))throw new TypeError(kC("invalid argument. Options argument must be an object. Value: `%s`.",r));t=zC({},r),n=a}else t={},n=a;return n;function a(o){return new JC(o,t)}function u(){return new JC(r,t)}}UC.exports=t0e});var DC=s(function(mHe,XC){"use strict";var BC=require("@stdlib/utils/define-nonenumerable-read-only-property"),$m=ad(),i0e=WC(),n0e=CC();BC($m,"objectMode",i0e);BC($m,"factory",n0e);XC.exports=$m});var YC=s(function(hHe,a0e){a0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var QC=s(function(pHe,ZC){"use strict";var s0e=require("@stdlib/assert/is-plain-object"),gr=require("@stdlib/assert/has-own-property"),u0e=require("@stdlib/assert/is-boolean").isPrimitive,o0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,HC=require("@stdlib/assert/is-string").isPrimitive,g0e=require("@stdlib/assert/is-positive-integer").isPrimitive,v0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tn=require("@stdlib/string/format");function f0e(r,e){return s0e(e)?gr(e,"sep")&&(r.sep=e.sep,!HC(r.sep))?new TypeError(Tn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):gr(e,"objectMode")&&(r.objectMode=e.objectMode,!u0e(r.objectMode))?new TypeError(Tn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):gr(e,"encoding")&&(r.encoding=e.encoding,!HC(r.encoding)&&r.encoding!==null)?new TypeError(Tn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):gr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!o0e(r.highWaterMark))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):gr(e,"iter")&&(r.iter=e.iter,!v0e(r.iter))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):gr(e,"siter")&&(r.siter=e.siter,!g0e(r.siter))?new TypeError(Tn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(gr(e,"prng")&&(r.prng=e.prng),gr(e,"seed")&&(r.seed=e.seed),gr(e,"state")&&(r.state=e.state),gr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Tn("invalid argument. Options argument must be an object. Value: `%s`.",e))}ZC.exports=f0e});var KC=s(function(yHe,$C){"use strict";var d0e=require("debug"),l0e=d0e("random:streams:gumbel");$C.exports=l0e});var ud=s(function(qHe,nB){"use strict";var iB=require("readable-stream").Readable,c0e=require("@stdlib/assert/is-positive-number").isPrimitive,m0e=require("@stdlib/assert/is-number").isPrimitive,h0e=require("@stdlib/math/base/assert/is-nan"),p0e=require("@stdlib/assert/is-error"),y0e=require("@stdlib/object/assign"),q0e=require("@stdlib/utils/inherit"),eB=require("@stdlib/utils/define-nonenumerable-property"),_i=require("@stdlib/utils/define-nonenumerable-read-only-property"),sd=require("@stdlib/utils/define-read-only-accessor"),b0e=require("@stdlib/utils/define-read-write-accessor"),w0e=eu().factory,rB=require("@stdlib/buffer/from-string"),S0e=require("@stdlib/utils/next-tick"),tB=require("@stdlib/string/format"),O0e=YC(),N0e=QC(),Ca=KC();function E0e(){return this._prng.seed}function L0e(){return this._prng.seedLength}function R0e(){return this._prng.stateLength}function P0e(){return this._prng.byteLength}function _0e(){return this._prng.state}function T0e(r){this._prng.state=r}function j0e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ca("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ca("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=rB(e):e=rB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function M0e(r){var e;if(this._destroyed)return Ca("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,S0e(i),this;function i(){r&&(Ca("Stream was destroyed due to an error. Error: %s.",p0e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ca("Closing the stream..."),e.emit("close")}}function pe(r,e,i){var t,n;if(!(this instanceof pe))return arguments.length>2?new pe(r,e,i):new pe(r,e);if(!m0e(r)||h0e(r))throw new TypeError(tB("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!c0e(e))throw new TypeError(tB("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=y0e({},O0e),arguments.length>2&&(n=N0e(t,i),n))throw n;return Ca("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),iB.call(this,t),eB(this,"_destroyed",!1),_i(this,"_objectMode",t.objectMode),_i(this,"_sep",t.sep),_i(this,"_iter",t.iter),_i(this,"_siter",t.siter),eB(this,"_i",0),_i(this,"_prng",w0e(r,e,t)),_i(this,"PRNG",this._prng.PRNG),this}q0e(pe,iB);sd(pe.prototype,"seed",E0e);sd(pe.prototype,"seedLength",L0e);b0e(pe.prototype,"state",_0e,T0e);sd(pe.prototype,"stateLength",R0e);sd(pe.prototype,"byteLength",P0e);_i(pe.prototype,"_read",j0e);_i(pe.prototype,"destroy",M0e);nB.exports=pe});var sB=s(function(bHe,aB){"use strict";var x0e=require("@stdlib/assert/is-plain-object"),G0e=require("@stdlib/object/assign"),A0e=require("@stdlib/string/format"),V0e=ud();function F0e(r,e,i){var t;if(arguments.length>2){if(t=i,!x0e(t))throw new TypeError(A0e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=G0e({},i)}else t={};return t.objectMode=!0,new V0e(r,e,t)}aB.exports=F0e});var dB=s(function(wHe,fB){"use strict";var uB=require("@stdlib/assert/is-plain-object"),oB=require("@stdlib/object/assign"),gB=require("@stdlib/string/format"),vB=ud();function W0e(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!uB(r))throw new TypeError(gB("invalid argument. Options argument must be an object. Value: `%s`.",r));n=oB({},r)}else if(t>2){if(!uB(i))throw new TypeError(gB("invalid argument. Options argument must be an object. Value: `%s`.",i));n=oB({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new vB(g,f,n)}function o(){return new vB(r,e,n)}}fB.exports=W0e});var mB=s(function(SHe,cB){"use strict";var lB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Km=ud(),I0e=sB(),z0e=dB();lB(Km,"objectMode",I0e);lB(Km,"factory",z0e);cB.exports=Km});var hB=s(function(OHe,k0e){k0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var qB=s(function(NHe,yB){"use strict";var J0e=require("@stdlib/assert/is-plain-object"),vr=require("@stdlib/assert/has-own-property"),U0e=require("@stdlib/assert/is-boolean").isPrimitive,C0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,pB=require("@stdlib/assert/is-string").isPrimitive,B0e=require("@stdlib/assert/is-positive-integer").isPrimitive,X0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jn=require("@stdlib/string/format");function D0e(r,e){return J0e(e)?vr(e,"sep")&&(r.sep=e.sep,!pB(r.sep))?new TypeError(jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):vr(e,"objectMode")&&(r.objectMode=e.objectMode,!U0e(r.objectMode))?new TypeError(jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):vr(e,"encoding")&&(r.encoding=e.encoding,!pB(r.encoding)&&r.encoding!==null)?new TypeError(jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):vr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!C0e(r.highWaterMark))?new TypeError(jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):vr(e,"iter")&&(r.iter=e.iter,!X0e(r.iter))?new TypeError(jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):vr(e,"siter")&&(r.siter=e.siter,!B0e(r.siter))?new TypeError(jn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(vr(e,"prng")&&(r.prng=e.prng),vr(e,"seed")&&(r.seed=e.seed),vr(e,"state")&&(r.state=e.state),vr(e,"copy")&&(r.copy=e.copy),null):new TypeError(jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}yB.exports=D0e});var wB=s(function(EHe,bB){"use strict";var Y0e=require("debug"),H0e=Y0e("random:streams:hypergeometric");bB.exports=H0e});var gd=s(function(LHe,EB){"use strict";var NB=require("readable-stream").Readable,eh=require("@stdlib/assert/is-nonnegative-integer"),Z0e=require("@stdlib/assert/is-error"),Q0e=require("@stdlib/object/assign"),$0e=require("@stdlib/utils/inherit"),SB=require("@stdlib/utils/define-nonenumerable-property"),Ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),od=require("@stdlib/utils/define-read-only-accessor"),K0e=require("@stdlib/utils/define-read-write-accessor"),eje=tu().factory,OB=require("@stdlib/buffer/from-string"),rje=require("@stdlib/utils/next-tick"),rh=require("@stdlib/string/format"),tje=hB(),ije=qB(),Ba=wB();function nje(){return this._prng.seed}function aje(){return this._prng.seedLength}function sje(){return this._prng.stateLength}function uje(){return this._prng.byteLength}function oje(){return this._prng.state}function gje(r){this._prng.state=r}function vje(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ba("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ba("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=OB(e):e=OB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function fje(r){var e;if(this._destroyed)return Ba("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rje(i),this;function i(){r&&(Ba("Stream was destroyed due to an error. Error: %s.",Z0e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ba("Closing the stream..."),e.emit("close")}}function ye(r,e,i,t){var n,a;if(!(this instanceof ye))return arguments.length>3?new ye(r,e,i,t):new ye(r,e,i);if(!eh(r))throw new TypeError(rh("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!eh(e))throw new TypeError(rh("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!eh(i))throw new TypeError(rh("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",i));if(i>r)throw new RangeError("invalid argument. Third argument must be less than or equal to the first argument.");if(e>r)throw new RangeError("invalid argument. Second argument must be less than or equal to the first argument.");if(n=Q0e({},tje),arguments.length>3&&(a=ije(n,t),a))throw a;return Ba("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),NB.call(this,n),SB(this,"_destroyed",!1),Ti(this,"_objectMode",n.objectMode),Ti(this,"_sep",n.sep),Ti(this,"_iter",n.iter),Ti(this,"_siter",n.siter),SB(this,"_i",0),Ti(this,"_prng",eje(r,e,i,n)),Ti(this,"PRNG",this._prng.PRNG),this}$0e(ye,NB);od(ye.prototype,"seed",nje);od(ye.prototype,"seedLength",aje);K0e(ye.prototype,"state",oje,gje);od(ye.prototype,"stateLength",sje);od(ye.prototype,"byteLength",uje);Ti(ye.prototype,"_read",vje);Ti(ye.prototype,"destroy",fje);EB.exports=ye});var RB=s(function(RHe,LB){"use strict";var dje=require("@stdlib/assert/is-plain-object"),lje=require("@stdlib/object/assign"),cje=require("@stdlib/string/format"),mje=gd();function hje(r,e,i,t){var n;if(arguments.length>3){if(n=t,!dje(n))throw new TypeError(cje("invalid argument. Options argument must be an object. Value: `%s`.",n));n=lje({},t)}else n={};return n.objectMode=!0,new mje(r,e,i,n)}LB.exports=hje});var xB=s(function(PHe,MB){"use strict";var PB=require("@stdlib/assert/is-plain-object"),_B=require("@stdlib/object/assign"),TB=require("@stdlib/string/format"),jB=gd();function pje(r,e,i,t){var n,a,u;if(n=arguments.length,n===1){if(!PB(r))throw new TypeError(TB("invalid argument. Options argument must be an object. Value: `%s`.",r));a=_B({},r)}else if(n>3){if(!PB(t))throw new TypeError(TB("invalid argument. Options argument must be an object. Value: `%s`.",t));a=_B({},t)}else a={};return n<3?u=o:u=g,u;function o(f,m,c){return new jB(f,m,c,a)}function g(){return new jB(r,e,i,a)}}MB.exports=pje});var VB=s(function(_He,AB){"use strict";var GB=require("@stdlib/utils/define-nonenumerable-read-only-property"),th=gd(),yje=RB(),qje=xB();GB(th,"objectMode",yje);GB(th,"factory",qje);AB.exports=th});var FB=s(function(THe,bje){bje.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var zB=s(function(jHe,IB){"use strict";var wje=require("@stdlib/assert/is-plain-object"),fr=require("@stdlib/assert/has-own-property"),Sje=require("@stdlib/assert/is-boolean").isPrimitive,Oje=require("@stdlib/assert/is-nonnegative-number").isPrimitive,WB=require("@stdlib/assert/is-string").isPrimitive,Nje=require("@stdlib/assert/is-positive-integer").isPrimitive,Eje=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mn=require("@stdlib/string/format");function Lje(r,e){return wje(e)?fr(e,"sep")&&(r.sep=e.sep,!WB(r.sep))?new TypeError(Mn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):fr(e,"objectMode")&&(r.objectMode=e.objectMode,!Sje(r.objectMode))?new TypeError(Mn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):fr(e,"encoding")&&(r.encoding=e.encoding,!WB(r.encoding)&&r.encoding!==null)?new TypeError(Mn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):fr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Oje(r.highWaterMark))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):fr(e,"iter")&&(r.iter=e.iter,!Eje(r.iter))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):fr(e,"siter")&&(r.siter=e.siter,!Nje(r.siter))?new TypeError(Mn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(fr(e,"prng")&&(r.prng=e.prng),fr(e,"seed")&&(r.seed=e.seed),fr(e,"state")&&(r.state=e.state),fr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Mn("invalid argument. Options argument must be an object. Value: `%s`.",e))}IB.exports=Lje});var JB=s(function(MHe,kB){"use strict";var Rje=require("debug"),Pje=Rje("random:streams:improved-ziggurat");kB.exports=Pje});var fd=s(function(xHe,XB){"use strict";var BB=require("readable-stream").Readable,_je=require("@stdlib/assert/is-error"),Tje=require("@stdlib/object/assign"),jje=require("@stdlib/utils/inherit"),UB=require("@stdlib/utils/define-nonenumerable-property"),ji=require("@stdlib/utils/define-nonenumerable-read-only-property"),vd=require("@stdlib/utils/define-read-only-accessor"),Mje=require("@stdlib/utils/define-read-write-accessor"),xje=H().factory,CB=require("@stdlib/buffer/from-string"),Gje=require("@stdlib/utils/next-tick"),Aje=FB(),Vje=zB(),Xa=JB();function Fje(){return this._prng.seed}function Wje(){return this._prng.seedLength}function Ije(){return this._prng.stateLength}function zje(){return this._prng.byteLength}function kje(){return this._prng.state}function Jje(r){this._prng.state=r}function Uje(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Xa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Xa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=CB(e):e=CB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Cje(r){var e;if(this._destroyed)return Xa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Gje(i),this;function i(){r&&(Xa("Stream was destroyed due to an error. Error: %s.",_je(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Xa("Closing the stream..."),e.emit("close")}}function qe(r){var e,i;if(!(this instanceof qe))return arguments.length>0?new qe(r):new qe;if(e=Tje({},Aje),arguments.length>0&&(i=Vje(e,r),i))throw i;return Xa("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),BB.call(this,e),UB(this,"_destroyed",!1),ji(this,"_objectMode",e.objectMode),ji(this,"_sep",e.sep),ji(this,"_iter",e.iter),ji(this,"_siter",e.siter),UB(this,"_i",0),ji(this,"_prng",xje(e)),ji(this,"PRNG",this._prng.PRNG),this}jje(qe,BB);vd(qe.prototype,"seed",Fje);vd(qe.prototype,"seedLength",Wje);Mje(qe.prototype,"state",kje,Jje);vd(qe.prototype,"stateLength",Ije);vd(qe.prototype,"byteLength",zje);ji(qe.prototype,"_read",Uje);ji(qe.prototype,"destroy",Cje);XB.exports=qe});var YB=s(function(GHe,DB){"use strict";var Bje=require("@stdlib/assert/is-plain-object"),Xje=require("@stdlib/object/assign"),Dje=require("@stdlib/string/format"),Yje=fd();function Hje(r){var e;if(arguments.length>0){if(e=r,!Bje(e))throw new TypeError(Dje("invalid argument. Options argument must be an object. Value: `%s`.",e));e=Xje({},r)}else e={};return e.objectMode=!0,new Yje(e)}DB.exports=Hje});var ZB=s(function(AHe,HB){"use strict";var Zje=require("@stdlib/assert/is-plain-object"),Qje=require("@stdlib/object/assign"),$je=require("@stdlib/string/format"),Kje=fd();function eMe(r){var e;if(arguments.length>0){if(!Zje(r))throw new TypeError($je("invalid argument. Options argument must be an object. Value: `%s`.",r));e=Qje({},r)}else e={};return i;function i(){return new Kje(e)}}HB.exports=eMe});var KB=s(function(VHe,$B){"use strict";var QB=require("@stdlib/utils/define-nonenumerable-read-only-property"),ih=fd(),rMe=YB(),tMe=ZB();QB(ih,"objectMode",rMe);QB(ih,"factory",tMe);$B.exports=ih});var e9=s(function(FHe,iMe){iMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var i9=s(function(WHe,t9){"use strict";var nMe=require("@stdlib/assert/is-plain-object"),dr=require("@stdlib/assert/has-own-property"),aMe=require("@stdlib/assert/is-boolean").isPrimitive,sMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,r9=require("@stdlib/assert/is-string").isPrimitive,uMe=require("@stdlib/assert/is-positive-integer").isPrimitive,oMe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xn=require("@stdlib/string/format");function gMe(r,e){return nMe(e)?dr(e,"sep")&&(r.sep=e.sep,!r9(r.sep))?new TypeError(xn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):dr(e,"objectMode")&&(r.objectMode=e.objectMode,!aMe(r.objectMode))?new TypeError(xn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):dr(e,"encoding")&&(r.encoding=e.encoding,!r9(r.encoding)&&r.encoding!==null)?new TypeError(xn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):dr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!sMe(r.highWaterMark))?new TypeError(xn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):dr(e,"iter")&&(r.iter=e.iter,!oMe(r.iter))?new TypeError(xn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):dr(e,"siter")&&(r.siter=e.siter,!uMe(r.siter))?new TypeError(xn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(dr(e,"prng")&&(r.prng=e.prng),dr(e,"seed")&&(r.seed=e.seed),dr(e,"state")&&(r.state=e.state),dr(e,"copy")&&(r.copy=e.copy),null):new TypeError(xn("invalid argument. Options argument must be an object. Value: `%s`.",e))}t9.exports=gMe});var a9=s(function(IHe,n9){"use strict";var vMe=require("debug"),fMe=vMe("random:streams:invgamma");n9.exports=fMe});var ld=s(function(zHe,f9){"use strict";var v9=require("readable-stream").Readable,s9=require("@stdlib/assert/is-positive-number").isPrimitive,dMe=require("@stdlib/assert/is-error"),lMe=require("@stdlib/object/assign"),cMe=require("@stdlib/utils/inherit"),u9=require("@stdlib/utils/define-nonenumerable-property"),Mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),dd=require("@stdlib/utils/define-read-only-accessor"),mMe=require("@stdlib/utils/define-read-write-accessor"),hMe=on().factory,o9=require("@stdlib/buffer/from-string"),pMe=require("@stdlib/utils/next-tick"),g9=require("@stdlib/string/format"),yMe=e9(),qMe=i9(),Da=a9();function bMe(){return this._prng.seed}function wMe(){return this._prng.seedLength}function SMe(){return this._prng.stateLength}function OMe(){return this._prng.byteLength}function NMe(){return this._prng.state}function EMe(r){this._prng.state=r}function LMe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Da("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Da("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=o9(e):e=o9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function RMe(r){var e;if(this._destroyed)return Da("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,pMe(i),this;function i(){r&&(Da("Stream was destroyed due to an error. Error: %s.",dMe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Da("Closing the stream..."),e.emit("close")}}function be(r,e,i){var t,n;if(!(this instanceof be))return arguments.length>2?new be(r,e,i):new be(r,e);if(!s9(r))throw new TypeError(g9("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!s9(e))throw new TypeError(g9("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=lMe({},yMe),arguments.length>2&&(n=qMe(t,i),n))throw n;return Da("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),v9.call(this,t),u9(this,"_destroyed",!1),Mi(this,"_objectMode",t.objectMode),Mi(this,"_sep",t.sep),Mi(this,"_iter",t.iter),Mi(this,"_siter",t.siter),u9(this,"_i",0),Mi(this,"_prng",hMe(r,e,t)),Mi(this,"PRNG",this._prng.PRNG),this}cMe(be,v9);dd(be.prototype,"seed",bMe);dd(be.prototype,"seedLength",wMe);mMe(be.prototype,"state",NMe,EMe);dd(be.prototype,"stateLength",SMe);dd(be.prototype,"byteLength",OMe);Mi(be.prototype,"_read",LMe);Mi(be.prototype,"destroy",RMe);f9.exports=be});var l9=s(function(kHe,d9){"use strict";var PMe=require("@stdlib/assert/is-plain-object"),_Me=require("@stdlib/object/assign"),TMe=require("@stdlib/string/format"),jMe=ld();function MMe(r,e,i){var t;if(arguments.length>2){if(t=i,!PMe(t))throw new TypeError(TMe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=_Me({},i)}else t={};return t.objectMode=!0,new jMe(r,e,t)}d9.exports=MMe});var q9=s(function(JHe,y9){"use strict";var c9=require("@stdlib/assert/is-plain-object"),m9=require("@stdlib/object/assign"),h9=require("@stdlib/string/format"),p9=ld();function xMe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!c9(r))throw new TypeError(h9("invalid argument. Options argument must be an object. Value: `%s`.",r));n=m9({},r)}else if(t>2){if(!c9(i))throw new TypeError(h9("invalid argument. Options argument must be an object. Value: `%s`.",i));n=m9({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new p9(g,f,n)}function o(){return new p9(r,e,n)}}y9.exports=xMe});var S9=s(function(UHe,w9){"use strict";var b9=require("@stdlib/utils/define-nonenumerable-read-only-property"),nh=ld(),GMe=l9(),AMe=q9();b9(nh,"objectMode",GMe);b9(nh,"factory",AMe);w9.exports=nh});var O9=s(function(CHe,VMe){VMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var L9=s(function(BHe,E9){"use strict";var FMe=require("@stdlib/assert/is-plain-object"),lr=require("@stdlib/assert/has-own-property"),WMe=require("@stdlib/assert/is-boolean").isPrimitive,IMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,N9=require("@stdlib/assert/is-string").isPrimitive,zMe=require("@stdlib/assert/is-positive-integer").isPrimitive,kMe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Gn=require("@stdlib/string/format");function JMe(r,e){return FMe(e)?lr(e,"sep")&&(r.sep=e.sep,!N9(r.sep))?new TypeError(Gn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):lr(e,"objectMode")&&(r.objectMode=e.objectMode,!WMe(r.objectMode))?new TypeError(Gn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):lr(e,"encoding")&&(r.encoding=e.encoding,!N9(r.encoding)&&r.encoding!==null)?new TypeError(Gn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!IMe(r.highWaterMark))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):lr(e,"iter")&&(r.iter=e.iter,!kMe(r.iter))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):lr(e,"siter")&&(r.siter=e.siter,!zMe(r.siter))?new TypeError(Gn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(lr(e,"prng")&&(r.prng=e.prng),lr(e,"seed")&&(r.seed=e.seed),lr(e,"state")&&(r.state=e.state),lr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Gn("invalid argument. Options argument must be an object. Value: `%s`.",e))}E9.exports=JMe});var P9=s(function(XHe,R9){"use strict";var UMe=require("debug"),CMe=UMe("random:streams:kumaraswamy");R9.exports=CMe});var md=s(function(DHe,G9){"use strict";var x9=require("readable-stream").Readable,_9=require("@stdlib/assert/is-positive-number").isPrimitive,BMe=require("@stdlib/assert/is-error"),XMe=require("@stdlib/object/assign"),DMe=require("@stdlib/utils/inherit"),T9=require("@stdlib/utils/define-nonenumerable-property"),xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),cd=require("@stdlib/utils/define-read-only-accessor"),YMe=require("@stdlib/utils/define-read-write-accessor"),HMe=iu().factory,j9=require("@stdlib/buffer/from-string"),ZMe=require("@stdlib/utils/next-tick"),M9=require("@stdlib/string/format"),QMe=O9(),$Me=L9(),Ya=P9();function KMe(){return this._prng.seed}function e1e(){return this._prng.seedLength}function r1e(){return this._prng.stateLength}function t1e(){return this._prng.byteLength}function i1e(){return this._prng.state}function n1e(r){this._prng.state=r}function a1e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ya("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ya("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=j9(e):e=j9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function s1e(r){var e;if(this._destroyed)return Ya("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,ZMe(i),this;function i(){r&&(Ya("Stream was destroyed due to an error. Error: %s.",BMe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ya("Closing the stream..."),e.emit("close")}}function we(r,e,i){var t,n;if(!(this instanceof we))return arguments.length>2?new we(r,e,i):new we(r,e);if(!_9(r))throw new TypeError(M9("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!_9(e))throw new TypeError(M9("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=XMe({},QMe),arguments.length>2&&(n=$Me(t,i),n))throw n;return Ya("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),x9.call(this,t),T9(this,"_destroyed",!1),xi(this,"_objectMode",t.objectMode),xi(this,"_sep",t.sep),xi(this,"_iter",t.iter),xi(this,"_siter",t.siter),T9(this,"_i",0),xi(this,"_prng",HMe(r,e,t)),xi(this,"PRNG",this._prng.PRNG),this}DMe(we,x9);cd(we.prototype,"seed",KMe);cd(we.prototype,"seedLength",e1e);YMe(we.prototype,"state",i1e,n1e);cd(we.prototype,"stateLength",r1e);cd(we.prototype,"byteLength",t1e);xi(we.prototype,"_read",a1e);xi(we.prototype,"destroy",s1e);G9.exports=we});var V9=s(function(YHe,A9){"use strict";var u1e=require("@stdlib/assert/is-plain-object"),o1e=require("@stdlib/object/assign"),g1e=require("@stdlib/string/format"),v1e=md();function f1e(r,e,i){var t;if(arguments.length>2){if(t=i,!u1e(t))throw new TypeError(g1e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=o1e({},i)}else t={};return t.objectMode=!0,new v1e(r,e,t)}A9.exports=f1e});var J9=s(function(HHe,k9){"use strict";var F9=require("@stdlib/assert/is-plain-object"),W9=require("@stdlib/object/assign"),I9=require("@stdlib/string/format"),z9=md();function d1e(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!F9(r))throw new TypeError(I9("invalid argument. Options argument must be an object. Value: `%s`.",r));n=W9({},r)}else if(t>2){if(!F9(i))throw new TypeError(I9("invalid argument. Options argument must be an object. Value: `%s`.",i));n=W9({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new z9(g,f,n)}function o(){return new z9(r,e,n)}}k9.exports=d1e});var B9=s(function(ZHe,C9){"use strict";var U9=require("@stdlib/utils/define-nonenumerable-read-only-property"),ah=md(),l1e=V9(),c1e=J9();U9(ah,"objectMode",l1e);U9(ah,"factory",c1e);C9.exports=ah});var X9=s(function(QHe,m1e){m1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var H9=s(function($He,Y9){"use strict";var h1e=require("@stdlib/assert/is-plain-object"),cr=require("@stdlib/assert/has-own-property"),p1e=require("@stdlib/assert/is-boolean").isPrimitive,y1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,D9=require("@stdlib/assert/is-string").isPrimitive,q1e=require("@stdlib/assert/is-positive-integer").isPrimitive,b1e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,An=require("@stdlib/string/format");function w1e(r,e){return h1e(e)?cr(e,"sep")&&(r.sep=e.sep,!D9(r.sep))?new TypeError(An("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):cr(e,"objectMode")&&(r.objectMode=e.objectMode,!p1e(r.objectMode))?new TypeError(An("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):cr(e,"encoding")&&(r.encoding=e.encoding,!D9(r.encoding)&&r.encoding!==null)?new TypeError(An("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):cr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!y1e(r.highWaterMark))?new TypeError(An("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):cr(e,"iter")&&(r.iter=e.iter,!b1e(r.iter))?new TypeError(An("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):cr(e,"siter")&&(r.siter=e.siter,!q1e(r.siter))?new TypeError(An("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(cr(e,"prng")&&(r.prng=e.prng),cr(e,"seed")&&(r.seed=e.seed),cr(e,"state")&&(r.state=e.state),cr(e,"copy")&&(r.copy=e.copy),null):new TypeError(An("invalid argument. Options argument must be an object. Value: `%s`.",e))}Y9.exports=w1e});var Q9=s(function(KHe,Z9){"use strict";var S1e=require("debug"),O1e=S1e("random:streams:laplace");Z9.exports=O1e});var pd=s(function(eZe,t8){"use strict";var r8=require("readable-stream").Readable,N1e=require("@stdlib/assert/is-positive-number").isPrimitive,E1e=require("@stdlib/assert/is-number").isPrimitive,L1e=require("@stdlib/math/base/assert/is-nan"),R1e=require("@stdlib/assert/is-error"),P1e=require("@stdlib/object/assign"),_1e=require("@stdlib/utils/inherit"),$9=require("@stdlib/utils/define-nonenumerable-property"),Gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),hd=require("@stdlib/utils/define-read-only-accessor"),T1e=require("@stdlib/utils/define-read-write-accessor"),j1e=nu().factory,K9=require("@stdlib/buffer/from-string"),e8=require("@stdlib/string/format"),M1e=require("@stdlib/utils/next-tick"),x1e=X9(),G1e=H9(),Ha=Q9();function A1e(){return this._prng.seed}function V1e(){return this._prng.seedLength}function F1e(){return this._prng.stateLength}function W1e(){return this._prng.byteLength}function I1e(){return this._prng.state}function z1e(r){this._prng.state=r}function k1e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ha("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ha("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=K9(e):e=K9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function J1e(r){var e;if(this._destroyed)return Ha("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,M1e(i),this;function i(){r&&(Ha("Stream was destroyed due to an error. Error: %s.",R1e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ha("Closing the stream..."),e.emit("close")}}function Se(r,e,i){var t,n;if(!(this instanceof Se))return arguments.length>2?new Se(r,e,i):new Se(r,e);if(!E1e(r)||L1e(r))throw new TypeError(e8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!N1e(e))throw new TypeError(e8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=P1e({},x1e),arguments.length>2&&(n=G1e(t,i),n))throw n;return Ha("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),r8.call(this,t),$9(this,"_destroyed",!1),Gi(this,"_objectMode",t.objectMode),Gi(this,"_sep",t.sep),Gi(this,"_iter",t.iter),Gi(this,"_siter",t.siter),$9(this,"_i",0),Gi(this,"_prng",j1e(r,e,t)),Gi(this,"PRNG",this._prng.PRNG),this}_1e(Se,r8);hd(Se.prototype,"seed",A1e);hd(Se.prototype,"seedLength",V1e);T1e(Se.prototype,"state",I1e,z1e);hd(Se.prototype,"stateLength",F1e);hd(Se.prototype,"byteLength",W1e);Gi(Se.prototype,"_read",k1e);Gi(Se.prototype,"destroy",J1e);t8.exports=Se});var n8=s(function(rZe,i8){"use strict";var U1e=require("@stdlib/assert/is-plain-object"),C1e=require("@stdlib/object/assign"),B1e=require("@stdlib/string/format"),X1e=pd();function D1e(r,e,i){var t;if(arguments.length>2){if(t=i,!U1e(t))throw new TypeError(B1e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=C1e({},i)}else t={};return t.objectMode=!0,new X1e(r,e,t)}i8.exports=D1e});var v8=s(function(tZe,g8){"use strict";var a8=require("@stdlib/assert/is-plain-object"),s8=require("@stdlib/object/assign"),u8=require("@stdlib/string/format"),o8=pd();function Y1e(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!a8(r))throw new TypeError(u8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=s8({},r)}else if(t>2){if(!a8(i))throw new TypeError(u8("invalid argument. Options argument must be an object. Value: `%s`.",i));n=s8({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new o8(g,f,n)}function o(){return new o8(r,e,n)}}g8.exports=Y1e});var l8=s(function(iZe,d8){"use strict";var f8=require("@stdlib/utils/define-nonenumerable-read-only-property"),sh=pd(),H1e=n8(),Z1e=v8();f8(sh,"objectMode",H1e);f8(sh,"factory",Z1e);d8.exports=sh});var c8=s(function(nZe,Q1e){Q1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var p8=s(function(aZe,h8){"use strict";var $1e=require("@stdlib/assert/is-plain-object"),mr=require("@stdlib/assert/has-own-property"),K1e=require("@stdlib/assert/is-boolean").isPrimitive,exe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,m8=require("@stdlib/assert/is-string").isPrimitive,rxe=require("@stdlib/assert/is-positive-integer").isPrimitive,txe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vn=require("@stdlib/string/format");function ixe(r,e){return $1e(e)?mr(e,"sep")&&(r.sep=e.sep,!m8(r.sep))?new TypeError(Vn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):mr(e,"objectMode")&&(r.objectMode=e.objectMode,!K1e(r.objectMode))?new TypeError(Vn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):mr(e,"encoding")&&(r.encoding=e.encoding,!m8(r.encoding)&&r.encoding!==null)?new TypeError(Vn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!exe(r.highWaterMark))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):mr(e,"iter")&&(r.iter=e.iter,!txe(r.iter))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):mr(e,"siter")&&(r.siter=e.siter,!rxe(r.siter))?new TypeError(Vn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(mr(e,"prng")&&(r.prng=e.prng),mr(e,"seed")&&(r.seed=e.seed),mr(e,"state")&&(r.state=e.state),mr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Vn("invalid argument. Options argument must be an object. Value: `%s`.",e))}h8.exports=ixe});var q8=s(function(sZe,y8){"use strict";var nxe=require("debug"),axe=nxe("random:streams:levy");y8.exports=axe});var qd=s(function(uZe,N8){"use strict";var O8=require("readable-stream").Readable,sxe=require("@stdlib/assert/is-positive-number").isPrimitive,uxe=require("@stdlib/assert/is-number").isPrimitive,oxe=require("@stdlib/math/base/assert/is-nan"),gxe=require("@stdlib/assert/is-error"),vxe=require("@stdlib/object/assign"),fxe=require("@stdlib/utils/inherit"),b8=require("@stdlib/utils/define-nonenumerable-property"),Ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),yd=require("@stdlib/utils/define-read-only-accessor"),dxe=require("@stdlib/utils/define-read-write-accessor"),lxe=au().factory,w8=require("@stdlib/buffer/from-string"),cxe=require("@stdlib/utils/next-tick"),S8=require("@stdlib/string/format"),mxe=c8(),hxe=p8(),Za=q8();function pxe(){return this._prng.seed}function yxe(){return this._prng.seedLength}function qxe(){return this._prng.stateLength}function bxe(){return this._prng.byteLength}function wxe(){return this._prng.state}function Sxe(r){this._prng.state=r}function Oxe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Za("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Za("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=w8(e):e=w8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Nxe(r){var e;if(this._destroyed)return Za("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,cxe(i),this;function i(){r&&(Za("Stream was destroyed due to an error. Error: %s.",gxe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Za("Closing the stream..."),e.emit("close")}}function Oe(r,e,i){var t,n;if(!(this instanceof Oe))return arguments.length>2?new Oe(r,e,i):new Oe(r,e);if(!uxe(r)||oxe(r))throw new TypeError(S8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!sxe(e))throw new TypeError(S8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=vxe({},mxe),arguments.length>2&&(n=hxe(t,i),n))throw n;return Za("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),O8.call(this,t),b8(this,"_destroyed",!1),Ai(this,"_objectMode",t.objectMode),Ai(this,"_sep",t.sep),Ai(this,"_iter",t.iter),Ai(this,"_siter",t.siter),b8(this,"_i",0),Ai(this,"_prng",lxe(r,e,t)),Ai(this,"PRNG",this._prng.PRNG),this}fxe(Oe,O8);yd(Oe.prototype,"seed",pxe);yd(Oe.prototype,"seedLength",yxe);dxe(Oe.prototype,"state",wxe,Sxe);yd(Oe.prototype,"stateLength",qxe);yd(Oe.prototype,"byteLength",bxe);Ai(Oe.prototype,"_read",Oxe);Ai(Oe.prototype,"destroy",Nxe);N8.exports=Oe});var L8=s(function(oZe,E8){"use strict";var Exe=require("@stdlib/assert/is-plain-object"),Lxe=require("@stdlib/object/assign"),Rxe=require("@stdlib/string/format"),Pxe=qd();function _xe(r,e,i){var t;if(arguments.length>2){if(t=i,!Exe(t))throw new TypeError(Rxe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=Lxe({},i)}else t={};return t.objectMode=!0,new Pxe(r,e,t)}E8.exports=_xe});var M8=s(function(gZe,j8){"use strict";var R8=require("@stdlib/assert/is-plain-object"),P8=require("@stdlib/object/assign"),_8=require("@stdlib/string/format"),T8=qd();function Txe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!R8(r))throw new TypeError(_8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=P8({},r)}else if(t>2){if(!R8(i))throw new TypeError(_8("invalid argument. Options argument must be an object. Value: `%s`.",i));n=P8({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new T8(g,f,n)}function o(){return new T8(r,e,n)}}j8.exports=Txe});var A8=s(function(vZe,G8){"use strict";var x8=require("@stdlib/utils/define-nonenumerable-read-only-property"),uh=qd(),jxe=L8(),Mxe=M8();x8(uh,"objectMode",jxe);x8(uh,"factory",Mxe);G8.exports=uh});var V8=s(function(fZe,xxe){xxe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var I8=s(function(dZe,W8){"use strict";var Gxe=require("@stdlib/assert/is-plain-object"),hr=require("@stdlib/assert/has-own-property"),Axe=require("@stdlib/assert/is-boolean").isPrimitive,Vxe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,F8=require("@stdlib/assert/is-string").isPrimitive,Fxe=require("@stdlib/assert/is-positive-integer").isPrimitive,Wxe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fn=require("@stdlib/string/format");function Ixe(r,e){return Gxe(e)?hr(e,"sep")&&(r.sep=e.sep,!F8(r.sep))?new TypeError(Fn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):hr(e,"objectMode")&&(r.objectMode=e.objectMode,!Axe(r.objectMode))?new TypeError(Fn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):hr(e,"encoding")&&(r.encoding=e.encoding,!F8(r.encoding)&&r.encoding!==null)?new TypeError(Fn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):hr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Vxe(r.highWaterMark))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):hr(e,"iter")&&(r.iter=e.iter,!Wxe(r.iter))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):hr(e,"siter")&&(r.siter=e.siter,!Fxe(r.siter))?new TypeError(Fn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(hr(e,"prng")&&(r.prng=e.prng),hr(e,"seed")&&(r.seed=e.seed),hr(e,"state")&&(r.state=e.state),hr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Fn("invalid argument. Options argument must be an object. Value: `%s`.",e))}W8.exports=Ixe});var k8=s(function(lZe,z8){"use strict";var zxe=require("debug"),kxe=zxe("random:streams:logistic");z8.exports=kxe});var wd=s(function(cZe,X8){"use strict";var B8=require("readable-stream").Readable,Jxe=require("@stdlib/assert/is-positive-number").isPrimitive,Uxe=require("@stdlib/assert/is-number").isPrimitive,Cxe=require("@stdlib/math/base/assert/is-nan"),Bxe=require("@stdlib/assert/is-error"),Xxe=require("@stdlib/object/assign"),Dxe=require("@stdlib/utils/inherit"),J8=require("@stdlib/utils/define-nonenumerable-property"),Vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),bd=require("@stdlib/utils/define-read-only-accessor"),Yxe=require("@stdlib/utils/define-read-write-accessor"),Hxe=su().factory,U8=require("@stdlib/buffer/from-string"),Zxe=require("@stdlib/utils/next-tick"),C8=require("@stdlib/string/format"),Qxe=V8(),$xe=I8(),Qa=k8();function Kxe(){return this._prng.seed}function eGe(){return this._prng.seedLength}function rGe(){return this._prng.stateLength}function tGe(){return this._prng.byteLength}function iGe(){return this._prng.state}function nGe(r){this._prng.state=r}function aGe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Qa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Qa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=U8(e):e=U8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function sGe(r){var e;if(this._destroyed)return Qa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Zxe(i),this;function i(){r&&(Qa("Stream was destroyed due to an error. Error: %s.",Bxe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Qa("Closing the stream..."),e.emit("close")}}function Ne(r,e,i){var t,n;if(!(this instanceof Ne))return arguments.length>2?new Ne(r,e,i):new Ne(r,e);if(!Uxe(r)||Cxe(r))throw new TypeError(C8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Jxe(e))throw new TypeError(C8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=Xxe({},Qxe),arguments.length>2&&(n=$xe(t,i),n))throw n;return Qa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),B8.call(this,t),J8(this,"_destroyed",!1),Vi(this,"_objectMode",t.objectMode),Vi(this,"_sep",t.sep),Vi(this,"_iter",t.iter),Vi(this,"_siter",t.siter),J8(this,"_i",0),Vi(this,"_prng",Hxe(r,e,t)),Vi(this,"PRNG",this._prng.PRNG),this}Dxe(Ne,B8);bd(Ne.prototype,"seed",Kxe);bd(Ne.prototype,"seedLength",eGe);Yxe(Ne.prototype,"state",iGe,nGe);bd(Ne.prototype,"stateLength",rGe);bd(Ne.prototype,"byteLength",tGe);Vi(Ne.prototype,"_read",aGe);Vi(Ne.prototype,"destroy",sGe);X8.exports=Ne});var Y8=s(function(mZe,D8){"use strict";var uGe=require("@stdlib/assert/is-plain-object"),oGe=require("@stdlib/object/assign"),gGe=require("@stdlib/string/format"),vGe=wd();function fGe(r,e,i){var t;if(arguments.length>2){if(t=i,!uGe(t))throw new TypeError(gGe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=oGe({},i)}else t={};return t.objectMode=!0,new vGe(r,e,t)}D8.exports=fGe});var eX=s(function(hZe,K8){"use strict";var H8=require("@stdlib/assert/is-plain-object"),Z8=require("@stdlib/object/assign"),Q8=require("@stdlib/string/format"),$8=wd();function dGe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!H8(r))throw new TypeError(Q8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Z8({},r)}else if(t>2){if(!H8(i))throw new TypeError(Q8("invalid argument. Options argument must be an object. Value: `%s`.",i));n=Z8({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new $8(g,f,n)}function o(){return new $8(r,e,n)}}K8.exports=dGe});var iX=s(function(pZe,tX){"use strict";var rX=require("@stdlib/utils/define-nonenumerable-read-only-property"),oh=wd(),lGe=Y8(),cGe=eX();rX(oh,"objectMode",lGe);rX(oh,"factory",cGe);tX.exports=oh});var nX=s(function(yZe,mGe){mGe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var uX=s(function(qZe,sX){"use strict";var hGe=require("@stdlib/assert/is-plain-object"),pr=require("@stdlib/assert/has-own-property"),pGe=require("@stdlib/assert/is-boolean").isPrimitive,yGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,aX=require("@stdlib/assert/is-string").isPrimitive,qGe=require("@stdlib/assert/is-positive-integer").isPrimitive,bGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Wn=require("@stdlib/string/format");function wGe(r,e){return hGe(e)?pr(e,"sep")&&(r.sep=e.sep,!aX(r.sep))?new TypeError(Wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):pr(e,"objectMode")&&(r.objectMode=e.objectMode,!pGe(r.objectMode))?new TypeError(Wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):pr(e,"encoding")&&(r.encoding=e.encoding,!aX(r.encoding)&&r.encoding!==null)?new TypeError(Wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!yGe(r.highWaterMark))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):pr(e,"iter")&&(r.iter=e.iter,!bGe(r.iter))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):pr(e,"siter")&&(r.siter=e.siter,!qGe(r.siter))?new TypeError(Wn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(pr(e,"prng")&&(r.prng=e.prng),pr(e,"seed")&&(r.seed=e.seed),pr(e,"state")&&(r.state=e.state),pr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}sX.exports=wGe});var gX=s(function(bZe,oX){"use strict";var SGe=require("debug"),OGe=SGe("random:streams:lognormal");oX.exports=OGe});var Od=s(function(wZe,cX){"use strict";var lX=require("readable-stream").Readable,NGe=require("@stdlib/assert/is-positive-number").isPrimitive,EGe=require("@stdlib/assert/is-number").isPrimitive,LGe=require("@stdlib/math/base/assert/is-nan"),RGe=require("@stdlib/assert/is-error"),PGe=require("@stdlib/object/assign"),_Ge=require("@stdlib/utils/inherit"),vX=require("@stdlib/utils/define-nonenumerable-property"),Fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sd=require("@stdlib/utils/define-read-only-accessor"),TGe=require("@stdlib/utils/define-read-write-accessor"),jGe=gn().factory,fX=require("@stdlib/buffer/from-string"),MGe=require("@stdlib/utils/next-tick"),dX=require("@stdlib/string/format"),xGe=nX(),GGe=uX(),$a=gX();function AGe(){return this._prng.seed}function VGe(){return this._prng.seedLength}function FGe(){return this._prng.stateLength}function WGe(){return this._prng.byteLength}function IGe(){return this._prng.state}function zGe(r){this._prng.state=r}function kGe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return $a("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),$a("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=fX(e):e=fX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function JGe(r){var e;if(this._destroyed)return $a("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,MGe(i),this;function i(){r&&($a("Stream was destroyed due to an error. Error: %s.",RGe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),$a("Closing the stream..."),e.emit("close")}}function Ee(r,e,i){var t,n;if(!(this instanceof Ee))return arguments.length>2?new Ee(r,e,i):new Ee(r,e);if(!EGe(r)||LGe(r))throw new TypeError(dX("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!NGe(e))throw new TypeError(dX("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=PGe({},xGe),arguments.length>2&&(n=GGe(t,i),n))throw n;return $a("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),lX.call(this,t),vX(this,"_destroyed",!1),Fi(this,"_objectMode",t.objectMode),Fi(this,"_sep",t.sep),Fi(this,"_iter",t.iter),Fi(this,"_siter",t.siter),vX(this,"_i",0),Fi(this,"_prng",jGe(r,e,t)),Fi(this,"PRNG",this._prng.PRNG),this}_Ge(Ee,lX);Sd(Ee.prototype,"seed",AGe);Sd(Ee.prototype,"seedLength",VGe);TGe(Ee.prototype,"state",IGe,zGe);Sd(Ee.prototype,"stateLength",FGe);Sd(Ee.prototype,"byteLength",WGe);Fi(Ee.prototype,"_read",kGe);Fi(Ee.prototype,"destroy",JGe);cX.exports=Ee});var hX=s(function(SZe,mX){"use strict";var UGe=require("@stdlib/assert/is-plain-object"),CGe=require("@stdlib/object/assign"),BGe=require("@stdlib/string/format"),XGe=Od();function DGe(r,e,i){var t;if(arguments.length>2){if(t=i,!UGe(t))throw new TypeError(BGe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=CGe({},i)}else t={};return t.objectMode=!0,new XGe(r,e,t)}mX.exports=DGe});var SX=s(function(OZe,wX){"use strict";var pX=require("@stdlib/assert/is-plain-object"),yX=require("@stdlib/object/assign"),qX=require("@stdlib/string/format"),bX=Od();function YGe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!pX(r))throw new TypeError(qX("invalid argument. Options argument must be an object. Value: `%s`.",r));n=yX({},r)}else if(t>2){if(!pX(i))throw new TypeError(qX("invalid argument. Options argument must be an object. Value: `%s`.",i));n=yX({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new bX(g,f,n)}function o(){return new bX(r,e,n)}}wX.exports=YGe});var EX=s(function(NZe,NX){"use strict";var OX=require("@stdlib/utils/define-nonenumerable-read-only-property"),gh=Od(),HGe=hX(),ZGe=SX();OX(gh,"objectMode",HGe);OX(gh,"factory",ZGe);NX.exports=gh});var LX=s(function(EZe,QGe){QGe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var TX=s(function(LZe,_X){"use strict";var $Ge=require("@stdlib/assert/is-plain-object"),yr=require("@stdlib/assert/has-own-property"),RX=require("@stdlib/assert/is-boolean").isPrimitive,KGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,PX=require("@stdlib/assert/is-string").isPrimitive,eAe=require("@stdlib/assert/is-positive-integer").isPrimitive,rAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Wi=require("@stdlib/string/format");function tAe(r,e){return $Ge(e)?yr(e,"sep")&&(r.sep=e.sep,!PX(r.sep))?new TypeError(Wi("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):yr(e,"objectMode")&&(r.objectMode=e.objectMode,!RX(r.objectMode))?new TypeError(Wi("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):yr(e,"encoding")&&(r.encoding=e.encoding,!PX(r.encoding)&&r.encoding!==null)?new TypeError(Wi("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):yr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!KGe(r.highWaterMark))?new TypeError(Wi("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):yr(e,"iter")&&(r.iter=e.iter,!rAe(r.iter))?new TypeError(Wi("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):yr(e,"siter")&&(r.siter=e.siter,!eAe(r.siter))?new TypeError(Wi("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):yr(e,"normalized")&&(r.normalized=e.normalized,!RX(r.normalized))?new TypeError(Wi("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(yr(e,"seed")&&(r.seed=e.seed),yr(e,"state")&&(r.state=e.state),yr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Wi("invalid argument. Options argument must be an object. Value: `%s`.",e))}_X.exports=tAe});var MX=s(function(RZe,jX){"use strict";var iAe=require("debug"),nAe=iAe("random:streams:minstd");jX.exports=nAe});var Ed=s(function(PZe,VX){"use strict";var AX=require("readable-stream").Readable,aAe=require("@stdlib/assert/is-error"),sAe=require("@stdlib/object/assign"),uAe=require("@stdlib/utils/inherit"),xX=require("@stdlib/utils/define-nonenumerable-property"),In=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nd=require("@stdlib/utils/define-read-only-accessor"),oAe=require("@stdlib/utils/define-read-write-accessor"),gAe=Z().factory,GX=require("@stdlib/buffer/from-string"),vAe=require("@stdlib/utils/next-tick"),fAe=LX(),dAe=TX(),Ka=MX();function lAe(){return this._prng.seed}function cAe(){return this._prng.seedLength}function mAe(){return this._prng.stateLength}function hAe(){return this._prng.byteLength}function pAe(){return this._prng.state}function yAe(r){this._prng.state=r}function qAe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ka("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ka("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=GX(e):e=GX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function bAe(r){var e;if(this._destroyed)return Ka("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,vAe(i),this;function i(){r&&(Ka("Stream was destroyed due to an error. Error: %s.",aAe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ka("Closing the stream..."),e.emit("close")}}function Le(r){var e,i,t;if(!(this instanceof Le))return arguments.length>0?new Le(r):new Le;if(i=sAe({},fAe),arguments.length>0&&(t=dAe(i,r),t))throw t;return Ka("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),AX.call(this,i),xX(this,"_destroyed",!1),In(this,"_objectMode",i.objectMode),In(this,"_sep",i.sep),In(this,"_iter",i.iter),In(this,"_siter",i.siter),xX(this,"_i",0),e=gAe(i),i.normalized&&(e=e.normalized),In(this,"_prng",e),this}uAe(Le,AX);Nd(Le.prototype,"seed",lAe);Nd(Le.prototype,"seedLength",cAe);oAe(Le.prototype,"state",pAe,yAe);Nd(Le.prototype,"stateLength",mAe);Nd(Le.prototype,"byteLength",hAe);In(Le.prototype,"_read",qAe);In(Le.prototype,"destroy",bAe);VX.exports=Le});var WX=s(function(_Ze,FX){"use strict";var wAe=require("@stdlib/assert/is-plain-object"),SAe=require("@stdlib/object/assign"),OAe=require("@stdlib/string/format"),NAe=Ed();function EAe(r){var e;if(arguments.length>0){if(e=r,!wAe(e))throw new TypeError(OAe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=SAe({},r)}else e={};return e.objectMode=!0,new NAe(e)}FX.exports=EAe});var zX=s(function(TZe,IX){"use strict";var LAe=require("@stdlib/assert/is-plain-object"),RAe=require("@stdlib/object/assign"),PAe=require("@stdlib/string/format"),_Ae=Ed();function TAe(r){var e;if(arguments.length>0){if(!LAe(r))throw new TypeError(PAe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=RAe({},r)}else e={};return i;function i(){return new _Ae(e)}}IX.exports=TAe});var UX=s(function(jZe,JX){"use strict";var kX=require("@stdlib/utils/define-nonenumerable-read-only-property"),vh=Ed(),jAe=WX(),MAe=zX();kX(vh,"objectMode",jAe);kX(vh,"factory",MAe);JX.exports=vh});var CX=s(function(MZe,xAe){xAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var YX=s(function(xZe,DX){"use strict";var GAe=require("@stdlib/assert/is-plain-object"),qr=require("@stdlib/assert/has-own-property"),BX=require("@stdlib/assert/is-boolean").isPrimitive,AAe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,XX=require("@stdlib/assert/is-string").isPrimitive,VAe=require("@stdlib/assert/is-positive-integer").isPrimitive,FAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ii=require("@stdlib/string/format");function WAe(r,e){return GAe(e)?qr(e,"sep")&&(r.sep=e.sep,!XX(r.sep))?new TypeError(Ii("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):qr(e,"objectMode")&&(r.objectMode=e.objectMode,!BX(r.objectMode))?new TypeError(Ii("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):qr(e,"encoding")&&(r.encoding=e.encoding,!XX(r.encoding)&&r.encoding!==null)?new TypeError(Ii("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):qr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!AAe(r.highWaterMark))?new TypeError(Ii("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):qr(e,"iter")&&(r.iter=e.iter,!FAe(r.iter))?new TypeError(Ii("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):qr(e,"siter")&&(r.siter=e.siter,!VAe(r.siter))?new TypeError(Ii("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):qr(e,"normalized")&&(r.normalized=e.normalized,!BX(r.normalized))?new TypeError(Ii("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(qr(e,"seed")&&(r.seed=e.seed),qr(e,"state")&&(r.state=e.state),qr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ii("invalid argument. Options argument must be an object. Value: `%s`.",e))}DX.exports=WAe});var ZX=s(function(GZe,HX){"use strict";var IAe=require("debug"),zAe=IAe("random:streams:minstd-shuffle");HX.exports=zAe});var Rd=s(function(AZe,e7){"use strict";var KX=require("readable-stream").Readable,kAe=require("@stdlib/assert/is-error"),JAe=require("@stdlib/object/assign"),UAe=require("@stdlib/utils/inherit"),QX=require("@stdlib/utils/define-nonenumerable-property"),zn=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ld=require("@stdlib/utils/define-read-only-accessor"),CAe=require("@stdlib/utils/define-read-write-accessor"),BAe=$().factory,$X=require("@stdlib/buffer/from-string"),XAe=require("@stdlib/utils/next-tick"),DAe=CX(),YAe=YX(),es=ZX();function HAe(){return this._prng.seed}function ZAe(){return this._prng.seedLength}function QAe(){return this._prng.stateLength}function $Ae(){return this._prng.byteLength}function KAe(){return this._prng.state}function eVe(r){this._prng.state=r}function rVe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return es("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),es("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=$X(e):e=$X(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function tVe(r){var e;if(this._destroyed)return es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,XAe(i),this;function i(){r&&(es("Stream was destroyed due to an error. Error: %s.",kAe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),es("Closing the stream..."),e.emit("close")}}function Re(r){var e,i,t;if(!(this instanceof Re))return arguments.length>0?new Re(r):new Re;if(i=JAe({},DAe),arguments.length>0&&(t=YAe(i,r),t))throw t;return es("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),KX.call(this,i),QX(this,"_destroyed",!1),zn(this,"_objectMode",i.objectMode),zn(this,"_sep",i.sep),zn(this,"_iter",i.iter),zn(this,"_siter",i.siter),QX(this,"_i",0),e=BAe(i),i.normalized&&(e=e.normalized),zn(this,"_prng",e),this}UAe(Re,KX);Ld(Re.prototype,"seed",HAe);Ld(Re.prototype,"seedLength",ZAe);CAe(Re.prototype,"state",KAe,eVe);Ld(Re.prototype,"stateLength",QAe);Ld(Re.prototype,"byteLength",$Ae);zn(Re.prototype,"_read",rVe);zn(Re.prototype,"destroy",tVe);e7.exports=Re});var t7=s(function(VZe,r7){"use strict";var iVe=require("@stdlib/assert/is-plain-object"),nVe=require("@stdlib/object/assign"),aVe=require("@stdlib/string/format"),sVe=Rd();function uVe(r){var e;if(arguments.length>0){if(e=r,!iVe(e))throw new TypeError(aVe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=nVe({},r)}else e={};return e.objectMode=!0,new sVe(e)}r7.exports=uVe});var n7=s(function(FZe,i7){"use strict";var oVe=require("@stdlib/assert/is-plain-object"),gVe=require("@stdlib/object/assign"),vVe=require("@stdlib/string/format"),fVe=Rd();function dVe(r){var e;if(arguments.length>0){if(!oVe(r))throw new TypeError(vVe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=gVe({},r)}else e={};return i;function i(){return new fVe(e)}}i7.exports=dVe});var u7=s(function(WZe,s7){"use strict";var a7=require("@stdlib/utils/define-nonenumerable-read-only-property"),fh=Rd(),lVe=t7(),cVe=n7();a7(fh,"objectMode",lVe);a7(fh,"factory",cVe);s7.exports=fh});var o7=s(function(IZe,mVe){mVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var d7=s(function(zZe,f7){"use strict";var hVe=require("@stdlib/assert/is-plain-object"),br=require("@stdlib/assert/has-own-property"),g7=require("@stdlib/assert/is-boolean").isPrimitive,pVe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,v7=require("@stdlib/assert/is-string").isPrimitive,yVe=require("@stdlib/assert/is-positive-integer").isPrimitive,qVe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zi=require("@stdlib/string/format");function bVe(r,e){return hVe(e)?br(e,"sep")&&(r.sep=e.sep,!v7(r.sep))?new TypeError(zi("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):br(e,"objectMode")&&(r.objectMode=e.objectMode,!g7(r.objectMode))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):br(e,"encoding")&&(r.encoding=e.encoding,!v7(r.encoding)&&r.encoding!==null)?new TypeError(zi("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):br(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!pVe(r.highWaterMark))?new TypeError(zi("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):br(e,"iter")&&(r.iter=e.iter,!qVe(r.iter))?new TypeError(zi("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):br(e,"siter")&&(r.siter=e.siter,!yVe(r.siter))?new TypeError(zi("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):br(e,"normalized")&&(r.normalized=e.normalized,!g7(r.normalized))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(br(e,"seed")&&(r.seed=e.seed),br(e,"state")&&(r.state=e.state),br(e,"copy")&&(r.copy=e.copy),null):new TypeError(zi("invalid argument. Options argument must be an object. Value: `%s`.",e))}f7.exports=bVe});var c7=s(function(kZe,l7){"use strict";var wVe=require("debug"),SVe=wVe("random:streams:mt19937");l7.exports=SVe});var _d=s(function(JZe,y7){"use strict";var p7=require("readable-stream").Readable,OVe=require("@stdlib/assert/is-error"),NVe=require("@stdlib/object/assign"),EVe=require("@stdlib/utils/inherit"),m7=require("@stdlib/utils/define-nonenumerable-property"),kn=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pd=require("@stdlib/utils/define-read-only-accessor"),LVe=require("@stdlib/utils/define-read-write-accessor"),RVe=j().factory,h7=require("@stdlib/buffer/from-string"),PVe=require("@stdlib/utils/next-tick"),_Ve=o7(),TVe=d7(),rs=c7();function jVe(){return this._prng.seed}function MVe(){return this._prng.seedLength}function xVe(){return this._prng.stateLength}function GVe(){return this._prng.byteLength}function AVe(){return this._prng.state}function VVe(r){this._prng.state=r}function FVe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return rs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),rs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=h7(e):e=h7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function WVe(r){var e;if(this._destroyed)return rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,PVe(i),this;function i(){r&&(rs("Stream was destroyed due to an error. Error: %s.",OVe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),rs("Closing the stream..."),e.emit("close")}}function Pe(r){var e,i,t;if(!(this instanceof Pe))return arguments.length>0?new Pe(r):new Pe;if(i=NVe({},_Ve),arguments.length>0&&(t=TVe(i,r),t))throw t;return rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),p7.call(this,i),m7(this,"_destroyed",!1),kn(this,"_objectMode",i.objectMode),kn(this,"_sep",i.sep),kn(this,"_iter",i.iter),kn(this,"_siter",i.siter),m7(this,"_i",0),e=RVe(i),i.normalized&&(e=e.normalized),kn(this,"_prng",e),this}EVe(Pe,p7);Pd(Pe.prototype,"seed",jVe);Pd(Pe.prototype,"seedLength",MVe);LVe(Pe.prototype,"state",AVe,VVe);Pd(Pe.prototype,"stateLength",xVe);Pd(Pe.prototype,"byteLength",GVe);kn(Pe.prototype,"_read",FVe);kn(Pe.prototype,"destroy",WVe);y7.exports=Pe});var b7=s(function(UZe,q7){"use strict";var IVe=require("@stdlib/assert/is-plain-object"),zVe=require("@stdlib/object/assign"),kVe=require("@stdlib/string/format"),JVe=_d();function UVe(r){var e;if(arguments.length>0){if(e=r,!IVe(e))throw new TypeError(kVe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=zVe({},r)}else e={};return e.objectMode=!0,new JVe(e)}q7.exports=UVe});var S7=s(function(CZe,w7){"use strict";var CVe=require("@stdlib/assert/is-plain-object"),BVe=require("@stdlib/object/assign"),XVe=require("@stdlib/string/format"),DVe=_d();function YVe(r){var e;if(arguments.length>0){if(!CVe(r))throw new TypeError(XVe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=BVe({},r)}else e={};return i;function i(){return new DVe(e)}}w7.exports=YVe});var E7=s(function(BZe,N7){"use strict";var O7=require("@stdlib/utils/define-nonenumerable-read-only-property"),dh=_d(),HVe=b7(),ZVe=S7();O7(dh,"objectMode",HVe);O7(dh,"factory",ZVe);N7.exports=dh});var L7=s(function(XZe,QVe){QVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var _7=s(function(DZe,P7){"use strict";var $Ve=require("@stdlib/assert/is-plain-object"),wr=require("@stdlib/assert/has-own-property"),KVe=require("@stdlib/assert/is-boolean").isPrimitive,e2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,R7=require("@stdlib/assert/is-string").isPrimitive,r2e=require("@stdlib/assert/is-positive-integer").isPrimitive,t2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jn=require("@stdlib/string/format");function i2e(r,e){return $Ve(e)?wr(e,"sep")&&(r.sep=e.sep,!R7(r.sep))?new TypeError(Jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):wr(e,"objectMode")&&(r.objectMode=e.objectMode,!KVe(r.objectMode))?new TypeError(Jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):wr(e,"encoding")&&(r.encoding=e.encoding,!R7(r.encoding)&&r.encoding!==null)?new TypeError(Jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):wr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!e2e(r.highWaterMark))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):wr(e,"iter")&&(r.iter=e.iter,!t2e(r.iter))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):wr(e,"siter")&&(r.siter=e.siter,!r2e(r.siter))?new TypeError(Jn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(wr(e,"prng")&&(r.prng=e.prng),wr(e,"seed")&&(r.seed=e.seed),wr(e,"state")&&(r.state=e.state),wr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}P7.exports=i2e});var j7=s(function(YZe,T7){"use strict";var n2e=require("debug"),a2e=n2e("random:streams:negative-binomial");T7.exports=a2e});var jd=s(function(HZe,V7){"use strict";var A7=require("readable-stream").Readable,s2e=require("@stdlib/assert/is-positive-number").isPrimitive,u2e=require("@stdlib/assert/is-probability").isPrimitive,o2e=require("@stdlib/assert/is-error"),g2e=require("@stdlib/object/assign"),v2e=require("@stdlib/utils/inherit"),M7=require("@stdlib/utils/define-nonenumerable-property"),ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),Td=require("@stdlib/utils/define-read-only-accessor"),f2e=require("@stdlib/utils/define-read-write-accessor"),d2e=uu().factory,x7=require("@stdlib/buffer/from-string"),l2e=require("@stdlib/utils/next-tick"),G7=require("@stdlib/string/format"),c2e=L7(),m2e=_7(),ts=j7();function h2e(){return this._prng.seed}function p2e(){return this._prng.seedLength}function y2e(){return this._prng.stateLength}function q2e(){return this._prng.byteLength}function b2e(){return this._prng.state}function w2e(r){this._prng.state=r}function S2e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ts("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ts("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=x7(e):e=x7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function O2e(r){var e;if(this._destroyed)return ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,l2e(i),this;function i(){r&&(ts("Stream was destroyed due to an error. Error: %s.",o2e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ts("Closing the stream..."),e.emit("close")}}function _e(r,e,i){var t,n;if(!(this instanceof _e))return arguments.length>2?new _e(r,e,i):new _e(r,e);if(!s2e(r))throw new TypeError(G7("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!u2e(e))throw new TypeError(G7("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(t=g2e({},c2e),arguments.length>2&&(n=m2e(t,i),n))throw n;return ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),A7.call(this,t),M7(this,"_destroyed",!1),ki(this,"_objectMode",t.objectMode),ki(this,"_sep",t.sep),ki(this,"_iter",t.iter),ki(this,"_siter",t.siter),M7(this,"_i",0),ki(this,"_prng",d2e(r,e,t)),ki(this,"PRNG",this._prng.PRNG),this}v2e(_e,A7);Td(_e.prototype,"seed",h2e);Td(_e.prototype,"seedLength",p2e);f2e(_e.prototype,"state",b2e,w2e);Td(_e.prototype,"stateLength",y2e);Td(_e.prototype,"byteLength",q2e);ki(_e.prototype,"_read",S2e);ki(_e.prototype,"destroy",O2e);V7.exports=_e});var W7=s(function(ZZe,F7){"use strict";var N2e=require("@stdlib/assert/is-plain-object"),E2e=require("@stdlib/object/assign"),L2e=require("@stdlib/string/format"),R2e=jd();function P2e(r,e,i){var t;if(arguments.length>2){if(t=i,!N2e(t))throw new TypeError(L2e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=E2e({},i)}else t={};return t.objectMode=!0,new R2e(r,e,t)}F7.exports=P2e});var C7=s(function(QZe,U7){"use strict";var I7=require("@stdlib/assert/is-plain-object"),z7=require("@stdlib/object/assign"),k7=require("@stdlib/string/format"),J7=jd();function _2e(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!I7(r))throw new TypeError(k7("invalid argument. Options argument must be an object. Value: `%s`.",r));n=z7({},r)}else if(t>2){if(!I7(i))throw new TypeError(k7("invalid argument. Options argument must be an object. Value: `%s`.",i));n=z7({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new J7(g,f,n)}function o(){return new J7(r,e,n)}}U7.exports=_2e});var D7=s(function($Ze,X7){"use strict";var B7=require("@stdlib/utils/define-nonenumerable-read-only-property"),lh=jd(),T2e=W7(),j2e=C7();B7(lh,"objectMode",T2e);B7(lh,"factory",j2e);X7.exports=lh});var Y7=s(function(KZe,M2e){M2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Q7=s(function(eQe,Z7){"use strict";var x2e=require("@stdlib/assert/is-plain-object"),Sr=require("@stdlib/assert/has-own-property"),G2e=require("@stdlib/assert/is-boolean").isPrimitive,A2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,H7=require("@stdlib/assert/is-string").isPrimitive,V2e=require("@stdlib/assert/is-positive-integer").isPrimitive,F2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Un=require("@stdlib/string/format");function W2e(r,e){return x2e(e)?Sr(e,"sep")&&(r.sep=e.sep,!H7(r.sep))?new TypeError(Un("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Sr(e,"objectMode")&&(r.objectMode=e.objectMode,!G2e(r.objectMode))?new TypeError(Un("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Sr(e,"encoding")&&(r.encoding=e.encoding,!H7(r.encoding)&&r.encoding!==null)?new TypeError(Un("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Sr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!A2e(r.highWaterMark))?new TypeError(Un("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Sr(e,"iter")&&(r.iter=e.iter,!F2e(r.iter))?new TypeError(Un("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Sr(e,"siter")&&(r.siter=e.siter,!V2e(r.siter))?new TypeError(Un("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Sr(e,"prng")&&(r.prng=e.prng),Sr(e,"seed")&&(r.seed=e.seed),Sr(e,"state")&&(r.state=e.state),Sr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Un("invalid argument. Options argument must be an object. Value: `%s`.",e))}Z7.exports=W2e});var K7=s(function(rQe,$7){"use strict";var I2e=require("debug"),z2e=I2e("random:streams:normal");$7.exports=z2e});var xd=s(function(tQe,nD){"use strict";var iD=require("readable-stream").Readable,k2e=require("@stdlib/assert/is-positive-number").isPrimitive,J2e=require("@stdlib/assert/is-number").isPrimitive,U2e=require("@stdlib/math/base/assert/is-nan"),C2e=require("@stdlib/assert/is-error"),B2e=require("@stdlib/object/assign"),X2e=require("@stdlib/utils/inherit"),eD=require("@stdlib/utils/define-nonenumerable-property"),Ji=require("@stdlib/utils/define-nonenumerable-read-only-property"),Md=require("@stdlib/utils/define-read-only-accessor"),D2e=require("@stdlib/utils/define-read-write-accessor"),Y2e=vn().factory,rD=require("@stdlib/buffer/from-string"),H2e=require("@stdlib/utils/next-tick"),tD=require("@stdlib/string/format"),Z2e=Y7(),Q2e=Q7(),is=K7();function $2e(){return this._prng.seed}function K2e(){return this._prng.seedLength}function eFe(){return this._prng.stateLength}function rFe(){return this._prng.byteLength}function tFe(){return this._prng.state}function iFe(r){this._prng.state=r}function nFe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return is("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),is("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=rD(e):e=rD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function aFe(r){var e;if(this._destroyed)return is("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,H2e(i),this;function i(){r&&(is("Stream was destroyed due to an error. Error: %s.",C2e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),is("Closing the stream..."),e.emit("close")}}function Te(r,e,i){var t,n;if(!(this instanceof Te))return arguments.length>2?new Te(r,e,i):new Te(r,e);if(!J2e(r)||U2e(r))throw new TypeError(tD("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!k2e(e))throw new TypeError(tD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=B2e({},Z2e),arguments.length>2&&(n=Q2e(t,i),n))throw n;return is("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),iD.call(this,t),eD(this,"_destroyed",!1),Ji(this,"_objectMode",t.objectMode),Ji(this,"_sep",t.sep),Ji(this,"_iter",t.iter),Ji(this,"_siter",t.siter),eD(this,"_i",0),Ji(this,"_prng",Y2e(r,e,t)),Ji(this,"PRNG",this._prng.PRNG),this}X2e(Te,iD);Md(Te.prototype,"seed",$2e);Md(Te.prototype,"seedLength",K2e);D2e(Te.prototype,"state",tFe,iFe);Md(Te.prototype,"stateLength",eFe);Md(Te.prototype,"byteLength",rFe);Ji(Te.prototype,"_read",nFe);Ji(Te.prototype,"destroy",aFe);nD.exports=Te});var sD=s(function(iQe,aD){"use strict";var sFe=require("@stdlib/assert/is-plain-object"),uFe=require("@stdlib/object/assign"),oFe=require("@stdlib/string/format"),gFe=xd();function vFe(r,e,i){var t;if(arguments.length>2){if(t=i,!sFe(t))throw new TypeError(oFe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=uFe({},i)}else t={};return t.objectMode=!0,new gFe(r,e,t)}aD.exports=vFe});var dD=s(function(nQe,fD){"use strict";var uD=require("@stdlib/assert/is-plain-object"),oD=require("@stdlib/object/assign"),gD=require("@stdlib/string/format"),vD=xd();function fFe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!uD(r))throw new TypeError(gD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=oD({},r)}else if(t>2){if(!uD(i))throw new TypeError(gD("invalid argument. Options argument must be an object. Value: `%s`.",i));n=oD({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new vD(g,f,n)}function o(){return new vD(r,e,n)}}fD.exports=fFe});var mD=s(function(aQe,cD){"use strict";var lD=require("@stdlib/utils/define-nonenumerable-read-only-property"),ch=xd(),dFe=sD(),lFe=dD();lD(ch,"objectMode",dFe);lD(ch,"factory",lFe);cD.exports=ch});var hD=s(function(sQe,cFe){cFe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var qD=s(function(uQe,yD){"use strict";var mFe=require("@stdlib/assert/is-plain-object"),Or=require("@stdlib/assert/has-own-property"),hFe=require("@stdlib/assert/is-boolean").isPrimitive,pFe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,pD=require("@stdlib/assert/is-string").isPrimitive,yFe=require("@stdlib/assert/is-positive-integer").isPrimitive,qFe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Cn=require("@stdlib/string/format");function bFe(r,e){return mFe(e)?Or(e,"sep")&&(r.sep=e.sep,!pD(r.sep))?new TypeError(Cn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Or(e,"objectMode")&&(r.objectMode=e.objectMode,!hFe(r.objectMode))?new TypeError(Cn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Or(e,"encoding")&&(r.encoding=e.encoding,!pD(r.encoding)&&r.encoding!==null)?new TypeError(Cn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!pFe(r.highWaterMark))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Or(e,"iter")&&(r.iter=e.iter,!qFe(r.iter))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Or(e,"siter")&&(r.siter=e.siter,!yFe(r.siter))?new TypeError(Cn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Or(e,"prng")&&(r.prng=e.prng),Or(e,"seed")&&(r.seed=e.seed),Or(e,"state")&&(r.state=e.state),Or(e,"copy")&&(r.copy=e.copy),null):new TypeError(Cn("invalid argument. Options argument must be an object. Value: `%s`.",e))}yD.exports=bFe});var wD=s(function(oQe,bD){"use strict";var wFe=require("debug"),SFe=wFe("random:streams:pareto1");bD.exports=SFe});var Ad=s(function(gQe,RD){"use strict";var LD=require("readable-stream").Readable,SD=require("@stdlib/assert/is-positive-number").isPrimitive,OFe=require("@stdlib/assert/is-error"),NFe=require("@stdlib/object/assign"),EFe=require("@stdlib/utils/inherit"),OD=require("@stdlib/utils/define-nonenumerable-property"),Ui=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gd=require("@stdlib/utils/define-read-only-accessor"),LFe=require("@stdlib/utils/define-read-write-accessor"),RFe=ou().factory,ND=require("@stdlib/buffer/from-string"),PFe=require("@stdlib/utils/next-tick"),ED=require("@stdlib/string/format"),_Fe=hD(),TFe=qD(),ns=wD();function jFe(){return this._prng.seed}function MFe(){return this._prng.seedLength}function xFe(){return this._prng.stateLength}function GFe(){return this._prng.byteLength}function AFe(){return this._prng.state}function VFe(r){this._prng.state=r}function FFe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ns("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ns("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=ND(e):e=ND(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function WFe(r){var e;if(this._destroyed)return ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,PFe(i),this;function i(){r&&(ns("Stream was destroyed due to an error. Error: %s.",OFe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ns("Closing the stream..."),e.emit("close")}}function je(r,e,i){var t,n;if(!(this instanceof je))return arguments.length>2?new je(r,e,i):new je(r,e);if(!SD(r))throw new TypeError(ED("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!SD(e))throw new TypeError(ED("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=NFe({},_Fe),arguments.length>2&&(n=TFe(t,i),n))throw n;return ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),LD.call(this,t),OD(this,"_destroyed",!1),Ui(this,"_objectMode",t.objectMode),Ui(this,"_sep",t.sep),Ui(this,"_iter",t.iter),Ui(this,"_siter",t.siter),OD(this,"_i",0),Ui(this,"_prng",RFe(r,e,t)),Ui(this,"PRNG",this._prng.PRNG),this}EFe(je,LD);Gd(je.prototype,"seed",jFe);Gd(je.prototype,"seedLength",MFe);LFe(je.prototype,"state",AFe,VFe);Gd(je.prototype,"stateLength",xFe);Gd(je.prototype,"byteLength",GFe);Ui(je.prototype,"_read",FFe);Ui(je.prototype,"destroy",WFe);RD.exports=je});var _D=s(function(vQe,PD){"use strict";var IFe=require("@stdlib/assert/is-plain-object"),zFe=require("@stdlib/object/assign"),kFe=require("@stdlib/string/format"),JFe=Ad();function UFe(r,e,i){var t;if(arguments.length>2){if(t=i,!IFe(t))throw new TypeError(kFe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=zFe({},i)}else t={};return t.objectMode=!0,new JFe(r,e,t)}PD.exports=UFe});var AD=s(function(fQe,GD){"use strict";var TD=require("@stdlib/assert/is-plain-object"),jD=require("@stdlib/object/assign"),MD=require("@stdlib/string/format"),xD=Ad();function CFe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!TD(r))throw new TypeError(MD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=jD({},r)}else if(t>2){if(!TD(i))throw new TypeError(MD("invalid argument. Options argument must be an object. Value: `%s`.",i));n=jD({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new xD(g,f,n)}function o(){return new xD(r,e,n)}}GD.exports=CFe});var WD=s(function(dQe,FD){"use strict";var VD=require("@stdlib/utils/define-nonenumerable-read-only-property"),mh=Ad(),BFe=_D(),XFe=AD();VD(mh,"objectMode",BFe);VD(mh,"factory",XFe);FD.exports=mh});var ID=s(function(lQe,DFe){DFe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var JD=s(function(cQe,kD){"use strict";var YFe=require("@stdlib/assert/is-plain-object"),Nr=require("@stdlib/assert/has-own-property"),HFe=require("@stdlib/assert/is-boolean").isPrimitive,ZFe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,zD=require("@stdlib/assert/is-string").isPrimitive,QFe=require("@stdlib/assert/is-positive-integer").isPrimitive,$Fe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Bn=require("@stdlib/string/format");function KFe(r,e){return YFe(e)?Nr(e,"sep")&&(r.sep=e.sep,!zD(r.sep))?new TypeError(Bn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Nr(e,"objectMode")&&(r.objectMode=e.objectMode,!HFe(r.objectMode))?new TypeError(Bn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Nr(e,"encoding")&&(r.encoding=e.encoding,!zD(r.encoding)&&r.encoding!==null)?new TypeError(Bn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!ZFe(r.highWaterMark))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Nr(e,"iter")&&(r.iter=e.iter,!$Fe(r.iter))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Nr(e,"siter")&&(r.siter=e.siter,!QFe(r.siter))?new TypeError(Bn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Nr(e,"prng")&&(r.prng=e.prng),Nr(e,"seed")&&(r.seed=e.seed),Nr(e,"state")&&(r.state=e.state),Nr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Bn("invalid argument. Options argument must be an object. Value: `%s`.",e))}kD.exports=KFe});var CD=s(function(mQe,UD){"use strict";var eWe=require("debug"),rWe=eWe("random:streams:poisson");UD.exports=rWe});var Fd=s(function(hQe,YD){"use strict";var DD=require("readable-stream").Readable,tWe=require("@stdlib/assert/is-positive-number").isPrimitive,iWe=require("@stdlib/assert/is-error"),nWe=require("@stdlib/object/assign"),aWe=require("@stdlib/utils/inherit"),BD=require("@stdlib/utils/define-nonenumerable-property"),Ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vd=require("@stdlib/utils/define-read-only-accessor"),sWe=require("@stdlib/utils/define-read-write-accessor"),uWe=qa().factory,XD=require("@stdlib/buffer/from-string"),oWe=require("@stdlib/string/format"),gWe=require("@stdlib/utils/next-tick"),vWe=ID(),fWe=JD(),as=CD();function dWe(){return this._prng.seed}function lWe(){return this._prng.seedLength}function cWe(){return this._prng.stateLength}function mWe(){return this._prng.byteLength}function hWe(){return this._prng.state}function pWe(r){this._prng.state=r}function yWe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return as("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),as("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=XD(e):e=XD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function qWe(r){var e;if(this._destroyed)return as("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,gWe(i),this;function i(){r&&(as("Stream was destroyed due to an error. Error: %s.",iWe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),as("Closing the stream..."),e.emit("close")}}function Me(r,e){var i,t;if(!(this instanceof Me))return arguments.length>1?new Me(r,e):new Me(r);if(!tWe(r))throw new TypeError(oWe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=nWe({},vWe),arguments.length>1&&(t=fWe(i,e),t))throw t;return as("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),DD.call(this,i),BD(this,"_destroyed",!1),Ci(this,"_objectMode",i.objectMode),Ci(this,"_sep",i.sep),Ci(this,"_iter",i.iter),Ci(this,"_siter",i.siter),BD(this,"_i",0),Ci(this,"_prng",uWe(r,i)),Ci(this,"PRNG",this._prng.PRNG),this}aWe(Me,DD);Vd(Me.prototype,"seed",dWe);Vd(Me.prototype,"seedLength",lWe);sWe(Me.prototype,"state",hWe,pWe);Vd(Me.prototype,"stateLength",cWe);Vd(Me.prototype,"byteLength",mWe);Ci(Me.prototype,"_read",yWe);Ci(Me.prototype,"destroy",qWe);YD.exports=Me});var ZD=s(function(pQe,HD){"use strict";var bWe=require("@stdlib/assert/is-plain-object"),wWe=require("@stdlib/object/assign"),SWe=require("@stdlib/string/format"),OWe=Fd();function NWe(r,e){var i;if(arguments.length>1){if(i=e,!bWe(i))throw new TypeError(SWe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=wWe({},e)}else i={};return i.objectMode=!0,new OWe(r,i)}HD.exports=NWe});var t5=s(function(yQe,r5){"use strict";var EWe=require("@stdlib/assert/is-positive-number").isPrimitive,QD=require("@stdlib/assert/is-plain-object"),$D=require("@stdlib/object/assign"),KD=require("@stdlib/string/format"),e5=Fd();function LWe(r,e){var i,t,n;if(i=arguments.length,i>1){if(!QD(e))throw new TypeError(KD("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=$D({},e)}else if(i===1)if(EWe(r))n=u,t={};else{if(!QD(r))throw new TypeError(KD("invalid argument. Options argument must be an object. Value: `%s`.",r));t=$D({},r),n=a}else t={},n=a;return n;function a(o){return new e5(o,t)}function u(){return new e5(r,t)}}r5.exports=LWe});var a5=s(function(qQe,n5){"use strict";var i5=require("@stdlib/utils/define-nonenumerable-read-only-property"),hh=Fd(),RWe=ZD(),PWe=t5();i5(hh,"objectMode",RWe);i5(hh,"factory",PWe);n5.exports=hh});var s5=s(function(bQe,_We){_We.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var g5=s(function(wQe,o5){"use strict";var TWe=require("@stdlib/assert/is-plain-object"),Er=require("@stdlib/assert/has-own-property"),jWe=require("@stdlib/assert/is-boolean").isPrimitive,MWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,u5=require("@stdlib/assert/is-string").isPrimitive,xWe=require("@stdlib/assert/is-positive-integer").isPrimitive,GWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Xn=require("@stdlib/string/format");function AWe(r,e){return TWe(e)?Er(e,"sep")&&(r.sep=e.sep,!u5(r.sep))?new TypeError(Xn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Er(e,"objectMode")&&(r.objectMode=e.objectMode,!jWe(r.objectMode))?new TypeError(Xn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Er(e,"encoding")&&(r.encoding=e.encoding,!u5(r.encoding)&&r.encoding!==null)?new TypeError(Xn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!MWe(r.highWaterMark))?new TypeError(Xn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Er(e,"iter")&&(r.iter=e.iter,!GWe(r.iter))?new TypeError(Xn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Er(e,"siter")&&(r.siter=e.siter,!xWe(r.siter))?new TypeError(Xn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Er(e,"name")&&(r.name=e.name),Er(e,"seed")&&(r.seed=e.seed),Er(e,"state")&&(r.state=e.state),Er(e,"copy")&&(r.copy=e.copy),null):new TypeError(Xn("invalid argument. Options argument must be an object. Value: `%s`.",e))}o5.exports=AWe});var f5=s(function(SQe,v5){"use strict";var VWe=require("debug"),FWe=VWe("random:streams:randi");v5.exports=FWe});var Id=s(function(OQe,m5){"use strict";var c5=require("readable-stream").Readable,WWe=require("@stdlib/assert/is-error"),IWe=require("@stdlib/object/assign"),zWe=require("@stdlib/utils/inherit"),d5=require("@stdlib/utils/define-nonenumerable-property"),Bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wd=require("@stdlib/utils/define-read-only-accessor"),kWe=require("@stdlib/utils/define-read-write-accessor"),JWe=fu().factory,l5=require("@stdlib/buffer/from-string"),UWe=require("@stdlib/utils/next-tick"),CWe=s5(),BWe=g5(),ss=f5();function XWe(){return this._prng.seed}function DWe(){return this._prng.seedLength}function YWe(){return this._prng.stateLength}function HWe(){return this._prng.byteLength}function ZWe(){return this._prng.state}function QWe(r){this._prng.state=r}function $We(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ss("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ss("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=l5(e):e=l5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function KWe(r){var e;if(this._destroyed)return ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,UWe(i),this;function i(){r&&(ss("Stream was destroyed due to an error. Error: %s.",WWe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ss("Closing the stream..."),e.emit("close")}}function xe(r){var e,i;if(!(this instanceof xe))return arguments.length>0?new xe(r):new xe;if(e=IWe({},CWe),arguments.length>0&&(i=BWe(e,r),i))throw i;return ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),c5.call(this,e),d5(this,"_destroyed",!1),Bi(this,"_objectMode",e.objectMode),Bi(this,"_sep",e.sep),Bi(this,"_iter",e.iter),Bi(this,"_siter",e.siter),d5(this,"_i",0),Bi(this,"_prng",JWe(e)),Bi(this,"PRNG",this._prng.PRNG),this}zWe(xe,c5);Wd(xe.prototype,"seed",XWe);Wd(xe.prototype,"seedLength",DWe);kWe(xe.prototype,"state",ZWe,QWe);Wd(xe.prototype,"stateLength",YWe);Wd(xe.prototype,"byteLength",HWe);Bi(xe.prototype,"_read",$We);Bi(xe.prototype,"destroy",KWe);m5.exports=xe});var p5=s(function(NQe,h5){"use strict";var eIe=require("@stdlib/assert/is-plain-object"),rIe=require("@stdlib/object/assign"),tIe=require("@stdlib/string/format"),iIe=Id();function nIe(r){var e;if(arguments.length>0){if(e=r,!eIe(e))throw new TypeError(tIe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=rIe({},r)}else e={};return e.objectMode=!0,new iIe(e)}h5.exports=nIe});var q5=s(function(EQe,y5){"use strict";var aIe=require("@stdlib/assert/is-plain-object"),sIe=require("@stdlib/object/assign"),uIe=require("@stdlib/string/format"),oIe=Id();function gIe(r){var e;if(arguments.length>0){if(!aIe(r))throw new TypeError(uIe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=sIe({},r)}else e={};return i;function i(){return new oIe(e)}}y5.exports=gIe});var S5=s(function(LQe,w5){"use strict";var b5=require("@stdlib/utils/define-nonenumerable-read-only-property"),ph=Id(),vIe=p5(),fIe=q5();b5(ph,"objectMode",vIe);b5(ph,"factory",fIe);w5.exports=ph});var O5=s(function(RQe,dIe){dIe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"improved-ziggurat"}});var L5=s(function(PQe,E5){"use strict";var lIe=require("@stdlib/assert/is-plain-object"),Ue=require("@stdlib/assert/has-own-property"),cIe=require("@stdlib/assert/is-boolean").isPrimitive,mIe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,N5=require("@stdlib/assert/is-string").isPrimitive,hIe=require("@stdlib/assert/is-positive-integer").isPrimitive,pIe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Dn=require("@stdlib/string/format");function yIe(r,e){return lIe(e)?Ue(e,"sep")&&(r.sep=e.sep,!N5(r.sep))?new TypeError(Dn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ue(e,"objectMode")&&(r.objectMode=e.objectMode,!cIe(r.objectMode))?new TypeError(Dn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ue(e,"encoding")&&(r.encoding=e.encoding,!N5(r.encoding)&&r.encoding!==null)?new TypeError(Dn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ue(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!mIe(r.highWaterMark))?new TypeError(Dn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ue(e,"iter")&&(r.iter=e.iter,!pIe(r.iter))?new TypeError(Dn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ue(e,"siter")&&(r.siter=e.siter,!hIe(r.siter))?new TypeError(Dn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ue(e,"name")&&(r.name=e.name),Ue(e,"prng")&&(r.prng=e.prng),Ue(e,"seed")&&(r.seed=e.seed),Ue(e,"state")&&(r.state=e.state),Ue(e,"copy")&&(r.copy=e.copy),null):new TypeError(Dn("invalid argument. Options argument must be an object. Value: `%s`.",e))}E5.exports=yIe});var P5=s(function(_Qe,R5){"use strict";var qIe=require("debug"),bIe=qIe("random:streams:randn");R5.exports=bIe});var kd=s(function(TQe,M5){"use strict";var j5=require("readable-stream").Readable,wIe=require("@stdlib/assert/is-error"),SIe=require("@stdlib/object/assign"),OIe=require("@stdlib/utils/inherit"),_5=require("@stdlib/utils/define-nonenumerable-property"),Xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),zd=require("@stdlib/utils/define-read-only-accessor"),NIe=require("@stdlib/utils/define-read-write-accessor"),EIe=lu().factory,T5=require("@stdlib/buffer/from-string"),LIe=require("@stdlib/utils/next-tick"),RIe=O5(),PIe=L5(),us=P5();function _Ie(){return this._prng.seed}function TIe(){return this._prng.seedLength}function jIe(){return this._prng.stateLength}function MIe(){return this._prng.byteLength}function xIe(){return this._prng.state}function GIe(r){this._prng.state=r}function AIe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return us("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),us("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=T5(e):e=T5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function VIe(r){var e;if(this._destroyed)return us("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,LIe(i),this;function i(){r&&(us("Stream was destroyed due to an error. Error: %s.",wIe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),us("Closing the stream..."),e.emit("close")}}function Ge(r){var e,i;if(!(this instanceof Ge))return arguments.length>0?new Ge(r):new Ge;if(e=SIe({},RIe),arguments.length>0&&(i=PIe(e,r),i))throw i;return us("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),j5.call(this,e),_5(this,"_destroyed",!1),Xi(this,"_objectMode",e.objectMode),Xi(this,"_sep",e.sep),Xi(this,"_iter",e.iter),Xi(this,"_siter",e.siter),_5(this,"_i",0),Xi(this,"_prng",EIe(e)),Xi(this,"PRNG",this._prng.PRNG),this}OIe(Ge,j5);zd(Ge.prototype,"seed",_Ie);zd(Ge.prototype,"seedLength",TIe);NIe(Ge.prototype,"state",xIe,GIe);zd(Ge.prototype,"stateLength",jIe);zd(Ge.prototype,"byteLength",MIe);Xi(Ge.prototype,"_read",AIe);Xi(Ge.prototype,"destroy",VIe);M5.exports=Ge});var G5=s(function(jQe,x5){"use strict";var FIe=require("@stdlib/assert/is-plain-object"),WIe=require("@stdlib/object/assign"),IIe=require("@stdlib/string/format"),zIe=kd();function kIe(r){var e;if(arguments.length>0){if(e=r,!FIe(e))throw new TypeError(IIe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=WIe({},r)}else e={};return e.objectMode=!0,new zIe(e)}x5.exports=kIe});var V5=s(function(MQe,A5){"use strict";var JIe=require("@stdlib/assert/is-plain-object"),UIe=require("@stdlib/object/assign"),CIe=require("@stdlib/string/format"),BIe=kd();function XIe(r){var e;if(arguments.length>0){if(!JIe(r))throw new TypeError(CIe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=UIe({},r)}else e={};return i;function i(){return new BIe(e)}}A5.exports=XIe});var I5=s(function(xQe,W5){"use strict";var F5=require("@stdlib/utils/define-nonenumerable-read-only-property"),yh=kd(),DIe=G5(),YIe=V5();F5(yh,"objectMode",DIe);F5(yh,"factory",YIe);W5.exports=yh});var z5=s(function(GQe,HIe){HIe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var U5=s(function(AQe,J5){"use strict";var ZIe=require("@stdlib/assert/is-plain-object"),Lr=require("@stdlib/assert/has-own-property"),QIe=require("@stdlib/assert/is-boolean").isPrimitive,$Ie=require("@stdlib/assert/is-nonnegative-number").isPrimitive,k5=require("@stdlib/assert/is-string").isPrimitive,KIe=require("@stdlib/assert/is-positive-integer").isPrimitive,eze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Yn=require("@stdlib/string/format");function rze(r,e){return ZIe(e)?Lr(e,"sep")&&(r.sep=e.sep,!k5(r.sep))?new TypeError(Yn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Lr(e,"objectMode")&&(r.objectMode=e.objectMode,!QIe(r.objectMode))?new TypeError(Yn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Lr(e,"encoding")&&(r.encoding=e.encoding,!k5(r.encoding)&&r.encoding!==null)?new TypeError(Yn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!$Ie(r.highWaterMark))?new TypeError(Yn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Lr(e,"iter")&&(r.iter=e.iter,!eze(r.iter))?new TypeError(Yn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Lr(e,"siter")&&(r.siter=e.siter,!KIe(r.siter))?new TypeError(Yn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Lr(e,"name")&&(r.name=e.name),Lr(e,"seed")&&(r.seed=e.seed),Lr(e,"state")&&(r.state=e.state),Lr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Yn("invalid argument. Options argument must be an object. Value: `%s`.",e))}J5.exports=rze});var B5=s(function(VQe,C5){"use strict";var tze=require("debug"),ize=tze("random:streams:randu");C5.exports=ize});var Ud=s(function(FQe,H5){"use strict";var Y5=require("readable-stream").Readable,nze=require("@stdlib/assert/is-error"),aze=require("@stdlib/object/assign"),sze=require("@stdlib/utils/inherit"),X5=require("@stdlib/utils/define-nonenumerable-property"),Di=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jd=require("@stdlib/utils/define-read-only-accessor"),uze=require("@stdlib/utils/define-read-write-accessor"),oze=bt().factory,D5=require("@stdlib/buffer/from-string"),gze=require("@stdlib/utils/next-tick"),vze=z5(),fze=U5(),os=B5();function dze(){return this._prng.seed}function lze(){return this._prng.seedLength}function cze(){return this._prng.stateLength}function mze(){return this._prng.byteLength}function hze(){return this._prng.state}function pze(r){this._prng.state=r}function yze(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return os("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),os("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=D5(e):e=D5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function qze(r){var e;if(this._destroyed)return os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,gze(i),this;function i(){r&&(os("Stream was destroyed due to an error. Error: %s.",nze(r)?r.message:JSON.stringify(r)),e.emit("error",r)),os("Closing the stream..."),e.emit("close")}}function Ae(r){var e,i;if(!(this instanceof Ae))return arguments.length>0?new Ae(r):new Ae;if(e=aze({},vze),arguments.length>0&&(i=fze(e,r),i))throw i;return os("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),Y5.call(this,e),X5(this,"_destroyed",!1),Di(this,"_objectMode",e.objectMode),Di(this,"_sep",e.sep),Di(this,"_iter",e.iter),Di(this,"_siter",e.siter),X5(this,"_i",0),Di(this,"_prng",oze(e)),Di(this,"PRNG",this._prng.PRNG),this}sze(Ae,Y5);Jd(Ae.prototype,"seed",dze);Jd(Ae.prototype,"seedLength",lze);uze(Ae.prototype,"state",hze,pze);Jd(Ae.prototype,"stateLength",cze);Jd(Ae.prototype,"byteLength",mze);Di(Ae.prototype,"_read",yze);Di(Ae.prototype,"destroy",qze);H5.exports=Ae});var Q5=s(function(WQe,Z5){"use strict";var bze=require("@stdlib/assert/is-plain-object"),wze=require("@stdlib/object/assign"),Sze=require("@stdlib/string/format"),Oze=Ud();function Nze(r){var e;if(arguments.length>0){if(e=r,!bze(e))throw new TypeError(Sze("invalid argument. Options argument must be an object. Value: `%s`.",e));e=wze({},r)}else e={};return e.objectMode=!0,new Oze(e)}Z5.exports=Nze});var K5=s(function(IQe,$5){"use strict";var Eze=require("@stdlib/assert/is-plain-object"),Lze=require("@stdlib/object/assign"),Rze=require("@stdlib/string/format"),Pze=Ud();function _ze(r){var e;if(arguments.length>0){if(!Eze(r))throw new TypeError(Rze("invalid argument. Options argument must be an object. Value: `%s`.",r));e=Lze({},r)}else e={};return i;function i(){return new Pze(e)}}$5.exports=_ze});var t6=s(function(zQe,r6){"use strict";var e6=require("@stdlib/utils/define-nonenumerable-read-only-property"),qh=Ud(),Tze=Q5(),jze=K5();e6(qh,"objectMode",Tze);e6(qh,"factory",jze);r6.exports=qh});var i6=s(function(kQe,Mze){Mze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var s6=s(function(JQe,a6){"use strict";var xze=require("@stdlib/assert/is-plain-object"),Rr=require("@stdlib/assert/has-own-property"),Gze=require("@stdlib/assert/is-boolean").isPrimitive,Aze=require("@stdlib/assert/is-nonnegative-number").isPrimitive,n6=require("@stdlib/assert/is-string").isPrimitive,Vze=require("@stdlib/assert/is-positive-integer").isPrimitive,Fze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Hn=require("@stdlib/string/format");function Wze(r,e){return xze(e)?Rr(e,"sep")&&(r.sep=e.sep,!n6(r.sep))?new TypeError(Hn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Rr(e,"objectMode")&&(r.objectMode=e.objectMode,!Gze(r.objectMode))?new TypeError(Hn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Rr(e,"encoding")&&(r.encoding=e.encoding,!n6(r.encoding)&&r.encoding!==null)?new TypeError(Hn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Aze(r.highWaterMark))?new TypeError(Hn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Rr(e,"iter")&&(r.iter=e.iter,!Fze(r.iter))?new TypeError(Hn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Rr(e,"siter")&&(r.siter=e.siter,!Vze(r.siter))?new TypeError(Hn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Rr(e,"prng")&&(r.prng=e.prng),Rr(e,"seed")&&(r.seed=e.seed),Rr(e,"state")&&(r.state=e.state),Rr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Hn("invalid argument. Options argument must be an object. Value: `%s`.",e))}a6.exports=Wze});var o6=s(function(UQe,u6){"use strict";var Ize=require("debug"),zze=Ize("random:streams:rayleigh");u6.exports=zze});var Bd=s(function(CQe,d6){"use strict";var f6=require("readable-stream").Readable,kze=require("@stdlib/assert/is-positive-number").isPrimitive,Jze=require("@stdlib/assert/is-error"),Uze=require("@stdlib/object/assign"),Cze=require("@stdlib/utils/inherit"),g6=require("@stdlib/utils/define-nonenumerable-property"),Yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cd=require("@stdlib/utils/define-read-only-accessor"),Bze=require("@stdlib/utils/define-read-write-accessor"),Xze=cu().factory,v6=require("@stdlib/buffer/from-string"),Dze=require("@stdlib/utils/next-tick"),Yze=require("@stdlib/string/format"),Hze=i6(),Zze=s6(),gs=o6();function Qze(){return this._prng.seed}function $ze(){return this._prng.seedLength}function Kze(){return this._prng.stateLength}function eke(){return this._prng.byteLength}function rke(){return this._prng.state}function tke(r){this._prng.state=r}function ike(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return gs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),gs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=v6(e):e=v6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nke(r){var e;if(this._destroyed)return gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Dze(i),this;function i(){r&&(gs("Stream was destroyed due to an error. Error: %s.",Jze(r)?r.message:JSON.stringify(r)),e.emit("error",r)),gs("Closing the stream..."),e.emit("close")}}function Ve(r,e){var i,t;if(!(this instanceof Ve))return arguments.length>1?new Ve(r,e):new Ve(r);if(!kze(r))throw new TypeError(Yze("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=Uze({},Hze),arguments.length>1&&(t=Zze(i,e),t))throw t;return gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),f6.call(this,i),g6(this,"_destroyed",!1),Yi(this,"_objectMode",i.objectMode),Yi(this,"_sep",i.sep),Yi(this,"_iter",i.iter),Yi(this,"_siter",i.siter),g6(this,"_i",0),Yi(this,"_prng",Xze(r,i)),Yi(this,"PRNG",this._prng.PRNG),this}Cze(Ve,f6);Cd(Ve.prototype,"seed",Qze);Cd(Ve.prototype,"seedLength",$ze);Bze(Ve.prototype,"state",rke,tke);Cd(Ve.prototype,"stateLength",Kze);Cd(Ve.prototype,"byteLength",eke);Yi(Ve.prototype,"_read",ike);Yi(Ve.prototype,"destroy",nke);d6.exports=Ve});var c6=s(function(BQe,l6){"use strict";var ake=require("@stdlib/assert/is-plain-object"),ske=require("@stdlib/object/assign"),uke=require("@stdlib/string/format"),oke=Bd();function gke(r,e){var i;if(arguments.length>1){if(i=e,!ake(i))throw new TypeError(uke("invalid argument. Options argument must be an object. Value: `%s`.",i));i=ske({},e)}else i={};return i.objectMode=!0,new oke(r,i)}l6.exports=gke});var b6=s(function(XQe,q6){"use strict";var vke=require("@stdlib/assert/is-positive-number").isPrimitive,m6=require("@stdlib/assert/is-plain-object"),h6=require("@stdlib/object/assign"),p6=require("@stdlib/string/format"),y6=Bd();function fke(r,e){var i,t,n;if(i=arguments.length,i>1){if(!m6(e))throw new TypeError(p6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=h6({},e)}else if(i===1)if(vke(r))n=u,t={};else{if(!m6(r))throw new TypeError(p6("invalid argument. Options argument must be an object. Value: `%s`.",r));t=h6({},r),n=a}else t={},n=a;return n;function a(o){return new y6(o,t)}function u(){return new y6(r,t)}}q6.exports=fke});var O6=s(function(DQe,S6){"use strict";var w6=require("@stdlib/utils/define-nonenumerable-read-only-property"),bh=Bd(),dke=c6(),lke=b6();w6(bh,"objectMode",dke);w6(bh,"factory",lke);S6.exports=bh});var N6=s(function(YQe,cke){cke.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var R6=s(function(HQe,L6){"use strict";var mke=require("@stdlib/assert/is-plain-object"),Pr=require("@stdlib/assert/has-own-property"),hke=require("@stdlib/assert/is-boolean").isPrimitive,pke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,E6=require("@stdlib/assert/is-string").isPrimitive,yke=require("@stdlib/assert/is-positive-integer").isPrimitive,qke=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zn=require("@stdlib/string/format");function bke(r,e){return mke(e)?Pr(e,"sep")&&(r.sep=e.sep,!E6(r.sep))?new TypeError(Zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Pr(e,"objectMode")&&(r.objectMode=e.objectMode,!hke(r.objectMode))?new TypeError(Zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Pr(e,"encoding")&&(r.encoding=e.encoding,!E6(r.encoding)&&r.encoding!==null)?new TypeError(Zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!pke(r.highWaterMark))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Pr(e,"iter")&&(r.iter=e.iter,!qke(r.iter))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Pr(e,"siter")&&(r.siter=e.siter,!yke(r.siter))?new TypeError(Zn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Pr(e,"prng")&&(r.prng=e.prng),Pr(e,"seed")&&(r.seed=e.seed),Pr(e,"state")&&(r.state=e.state),Pr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}L6.exports=bke});var _6=s(function(ZQe,P6){"use strict";var wke=require("debug"),Ske=wke("random:streams:t");P6.exports=Ske});var Dd=s(function(QQe,x6){"use strict";var M6=require("readable-stream").Readable,Oke=require("@stdlib/assert/is-positive-number").isPrimitive,Nke=require("@stdlib/assert/is-error"),Eke=require("@stdlib/object/assign"),Lke=require("@stdlib/utils/inherit"),T6=require("@stdlib/utils/define-nonenumerable-property"),Hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xd=require("@stdlib/utils/define-read-only-accessor"),Rke=require("@stdlib/utils/define-read-write-accessor"),Pke=mu().factory,j6=require("@stdlib/buffer/from-string"),_ke=require("@stdlib/utils/next-tick"),Tke=require("@stdlib/string/format"),jke=N6(),Mke=R6(),vs=_6();function xke(){return this._prng.seed}function Gke(){return this._prng.seedLength}function Ake(){return this._prng.stateLength}function Vke(){return this._prng.byteLength}function Fke(){return this._prng.state}function Wke(r){this._prng.state=r}function Ike(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return vs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),vs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=j6(e):e=j6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function zke(r){var e;if(this._destroyed)return vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,_ke(i),this;function i(){r&&(vs("Stream was destroyed due to an error. Error: %s.",Nke(r)?r.message:JSON.stringify(r)),e.emit("error",r)),vs("Closing the stream..."),e.emit("close")}}function Fe(r,e){var i,t;if(!(this instanceof Fe))return arguments.length>1?new Fe(r,e):new Fe(r);if(!Oke(r))throw new TypeError(Tke("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(i=Eke({},jke),arguments.length>1&&(t=Mke(i,e),t))throw t;return vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),M6.call(this,i),T6(this,"_destroyed",!1),Hi(this,"_objectMode",i.objectMode),Hi(this,"_sep",i.sep),Hi(this,"_iter",i.iter),Hi(this,"_siter",i.siter),T6(this,"_i",0),Hi(this,"_prng",Pke(r,i)),Hi(this,"PRNG",this._prng.PRNG),this}Lke(Fe,M6);Xd(Fe.prototype,"seed",xke);Xd(Fe.prototype,"seedLength",Gke);Rke(Fe.prototype,"state",Fke,Wke);Xd(Fe.prototype,"stateLength",Ake);Xd(Fe.prototype,"byteLength",Vke);Hi(Fe.prototype,"_read",Ike);Hi(Fe.prototype,"destroy",zke);x6.exports=Fe});var A6=s(function($Qe,G6){"use strict";var kke=require("@stdlib/assert/is-plain-object"),Jke=require("@stdlib/object/assign"),Uke=require("@stdlib/string/format"),Cke=Dd();function Bke(r,e){var i;if(arguments.length>1){if(i=e,!kke(i))throw new TypeError(Uke("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Jke({},e)}else i={};return i.objectMode=!0,new Cke(r,i)}G6.exports=Bke});var k6=s(function(KQe,z6){"use strict";var Xke=require("@stdlib/assert/is-positive-number").isPrimitive,V6=require("@stdlib/assert/is-plain-object"),F6=require("@stdlib/object/assign"),W6=require("@stdlib/string/format"),I6=Dd();function Dke(r,e){var i,t,n;if(i=arguments.length,i>1){if(!V6(e))throw new TypeError(W6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,t=F6({},e)}else if(i===1)if(Xke(r))n=u,t={};else{if(!V6(r))throw new TypeError(W6("invalid argument. Options argument must be an object. Value: `%s`.",r));t=F6({},r),n=a}else t={},n=a;return n;function a(o){return new I6(o,t)}function u(){return new I6(r,t)}}z6.exports=Dke});var C6=s(function(e$e,U6){"use strict";var J6=require("@stdlib/utils/define-nonenumerable-read-only-property"),wh=Dd(),Yke=A6(),Hke=k6();J6(wh,"objectMode",Yke);J6(wh,"factory",Hke);U6.exports=wh});var B6=s(function(r$e,Zke){Zke.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Y6=s(function(t$e,D6){"use strict";var Qke=require("@stdlib/assert/is-plain-object"),_r=require("@stdlib/assert/has-own-property"),$ke=require("@stdlib/assert/is-boolean").isPrimitive,Kke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,X6=require("@stdlib/assert/is-string").isPrimitive,e3e=require("@stdlib/assert/is-positive-integer").isPrimitive,r3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qn=require("@stdlib/string/format");function t3e(r,e){return Qke(e)?_r(e,"sep")&&(r.sep=e.sep,!X6(r.sep))?new TypeError(Qn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):_r(e,"objectMode")&&(r.objectMode=e.objectMode,!$ke(r.objectMode))?new TypeError(Qn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):_r(e,"encoding")&&(r.encoding=e.encoding,!X6(r.encoding)&&r.encoding!==null)?new TypeError(Qn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):_r(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Kke(r.highWaterMark))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):_r(e,"iter")&&(r.iter=e.iter,!r3e(r.iter))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):_r(e,"siter")&&(r.siter=e.siter,!e3e(r.siter))?new TypeError(Qn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(_r(e,"prng")&&(r.prng=e.prng),_r(e,"seed")&&(r.seed=e.seed),_r(e,"state")&&(r.state=e.state),_r(e,"copy")&&(r.copy=e.copy),null):new TypeError(Qn("invalid argument. Options argument must be an object. Value: `%s`.",e))}D6.exports=t3e});var Z6=s(function(i$e,H6){"use strict";var i3e=require("debug"),n3e=i3e("random:streams:triangular");H6.exports=n3e});var Zd=s(function(n$e,e4){"use strict";var K6=require("readable-stream").Readable,Sh=require("@stdlib/assert/is-number").isPrimitive,Oh=require("@stdlib/math/base/assert/is-nan"),a3e=require("@stdlib/assert/is-error"),s3e=require("@stdlib/object/assign"),u3e=require("@stdlib/utils/inherit"),Q6=require("@stdlib/utils/define-nonenumerable-property"),Zi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hd=require("@stdlib/utils/define-read-only-accessor"),o3e=require("@stdlib/utils/define-read-write-accessor"),g3e=hu().factory,$6=require("@stdlib/buffer/from-string"),v3e=require("@stdlib/utils/next-tick"),Yd=require("@stdlib/string/format"),f3e=B6(),d3e=Y6(),fs=Z6();function l3e(){return this._prng.seed}function c3e(){return this._prng.seedLength}function m3e(){return this._prng.stateLength}function h3e(){return this._prng.byteLength}function p3e(){return this._prng.state}function y3e(r){this._prng.state=r}function q3e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return fs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),fs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=$6(e):e=$6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function b3e(r){var e;if(this._destroyed)return fs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,v3e(i),this;function i(){r&&(fs("Stream was destroyed due to an error. Error: %s.",a3e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),fs("Closing the stream..."),e.emit("close")}}function We(r,e,i,t){var n,a;if(!(this instanceof We))return arguments.length>3?new We(r,e,i,t):new We(r,e,i);if(!Sh(r)||Oh(r))throw new TypeError(Yd("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Sh(e)||Oh(e))throw new TypeError(Yd("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!Sh(i)||Oh(i))throw new TypeError(Yd("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",i));if(!(r<=i&&i<=e))throw new RangeError(Yd("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,i));if(n=s3e({},f3e),arguments.length>3&&(a=d3e(n,t),a))throw a;return fs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),K6.call(this,n),Q6(this,"_destroyed",!1),Zi(this,"_objectMode",n.objectMode),Zi(this,"_sep",n.sep),Zi(this,"_iter",n.iter),Zi(this,"_siter",n.siter),Q6(this,"_i",0),Zi(this,"_prng",g3e(r,e,i,n)),Zi(this,"PRNG",this._prng.PRNG),this}u3e(We,K6);Hd(We.prototype,"seed",l3e);Hd(We.prototype,"seedLength",c3e);o3e(We.prototype,"state",p3e,y3e);Hd(We.prototype,"stateLength",m3e);Hd(We.prototype,"byteLength",h3e);Zi(We.prototype,"_read",q3e);Zi(We.prototype,"destroy",b3e);e4.exports=We});var t4=s(function(a$e,r4){"use strict";var w3e=require("@stdlib/assert/is-plain-object"),S3e=require("@stdlib/object/assign"),O3e=require("@stdlib/string/format"),N3e=Zd();function E3e(r,e,i,t){var n;if(arguments.length>3){if(n=t,!w3e(n))throw new TypeError(O3e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=S3e({},t)}else n={};return n.objectMode=!0,new N3e(r,e,i,n)}r4.exports=E3e});var o4=s(function(s$e,u4){"use strict";var i4=require("@stdlib/assert/is-plain-object"),n4=require("@stdlib/object/assign"),a4=require("@stdlib/string/format"),s4=Zd();function L3e(r,e,i,t){var n,a,u;if(n=arguments.length,n===1){if(!i4(r))throw new TypeError(a4("invalid argument. Options argument must be an object. Value: `%s`.",r));a=n4({},r)}else if(n>3){if(!i4(t))throw new TypeError(a4("invalid argument. Options argument must be an object. Value: `%s`.",t));a=n4({},t)}else a={};return n<3?u=o:u=g,u;function o(f,m,c){return new s4(f,m,c,a)}function g(){return new s4(r,e,i,a)}}u4.exports=L3e});var f4=s(function(u$e,v4){"use strict";var g4=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nh=Zd(),R3e=t4(),P3e=o4();g4(Nh,"objectMode",R3e);g4(Nh,"factory",P3e);v4.exports=Nh});var d4=s(function(o$e,_3e){_3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var m4=s(function(g$e,c4){"use strict";var T3e=require("@stdlib/assert/is-plain-object"),Tr=require("@stdlib/assert/has-own-property"),j3e=require("@stdlib/assert/is-boolean").isPrimitive,M3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,l4=require("@stdlib/assert/is-string").isPrimitive,x3e=require("@stdlib/assert/is-positive-integer").isPrimitive,G3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$n=require("@stdlib/string/format");function A3e(r,e){return T3e(e)?Tr(e,"sep")&&(r.sep=e.sep,!l4(r.sep))?new TypeError($n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Tr(e,"objectMode")&&(r.objectMode=e.objectMode,!j3e(r.objectMode))?new TypeError($n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Tr(e,"encoding")&&(r.encoding=e.encoding,!l4(r.encoding)&&r.encoding!==null)?new TypeError($n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!M3e(r.highWaterMark))?new TypeError($n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Tr(e,"iter")&&(r.iter=e.iter,!G3e(r.iter))?new TypeError($n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Tr(e,"siter")&&(r.siter=e.siter,!x3e(r.siter))?new TypeError($n("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Tr(e,"prng")&&(r.prng=e.prng),Tr(e,"seed")&&(r.seed=e.seed),Tr(e,"state")&&(r.state=e.state),Tr(e,"copy")&&(r.copy=e.copy),null):new TypeError($n("invalid argument. Options argument must be an object. Value: `%s`.",e))}c4.exports=A3e});var p4=s(function(v$e,h4){"use strict";var V3e=require("debug"),F3e=V3e("random:streams:uniform");h4.exports=F3e});var $d=s(function(f$e,O4){"use strict";var S4=require("readable-stream").Readable,y4=require("@stdlib/assert/is-number").isPrimitive,q4=require("@stdlib/math/base/assert/is-nan"),W3e=require("@stdlib/assert/is-error"),I3e=require("@stdlib/object/assign"),z3e=require("@stdlib/utils/inherit"),b4=require("@stdlib/utils/define-nonenumerable-property"),Qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qd=require("@stdlib/utils/define-read-only-accessor"),k3e=require("@stdlib/utils/define-read-write-accessor"),J3e=fn().factory,w4=require("@stdlib/buffer/from-string"),U3e=require("@stdlib/utils/next-tick"),Eh=require("@stdlib/string/format"),C3e=d4(),B3e=m4(),ds=p4();function X3e(){return this._prng.seed}function D3e(){return this._prng.seedLength}function Y3e(){return this._prng.stateLength}function H3e(){return this._prng.byteLength}function Z3e(){return this._prng.state}function Q3e(r){this._prng.state=r}function $3e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ds("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ds("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=w4(e):e=w4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function K3e(r){var e;if(this._destroyed)return ds("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,U3e(i),this;function i(){r&&(ds("Stream was destroyed due to an error. Error: %s.",W3e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ds("Closing the stream..."),e.emit("close")}}function Ie(r,e,i){var t,n;if(!(this instanceof Ie))return arguments.length>2?new Ie(r,e,i):new Ie(r,e);if(!y4(r)||q4(r))throw new TypeError(Eh("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!y4(e)||q4(e))throw new TypeError(Eh("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(Eh("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(t=I3e({},C3e),arguments.length>2&&(n=B3e(t,i),n))throw n;return ds("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),S4.call(this,t),b4(this,"_destroyed",!1),Qi(this,"_objectMode",t.objectMode),Qi(this,"_sep",t.sep),Qi(this,"_iter",t.iter),Qi(this,"_siter",t.siter),b4(this,"_i",0),Qi(this,"_prng",J3e(r,e,t)),Qi(this,"PRNG",this._prng.PRNG),this}z3e(Ie,S4);Qd(Ie.prototype,"seed",X3e);Qd(Ie.prototype,"seedLength",D3e);k3e(Ie.prototype,"state",Z3e,Q3e);Qd(Ie.prototype,"stateLength",Y3e);Qd(Ie.prototype,"byteLength",H3e);Qi(Ie.prototype,"_read",$3e);Qi(Ie.prototype,"destroy",K3e);O4.exports=Ie});var E4=s(function(d$e,N4){"use strict";var eJe=require("@stdlib/assert/is-plain-object"),rJe=require("@stdlib/object/assign"),tJe=require("@stdlib/string/format"),iJe=$d();function nJe(r,e,i){var t;if(arguments.length>2){if(t=i,!eJe(t))throw new TypeError(tJe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=rJe({},i)}else t={};return t.objectMode=!0,new iJe(r,e,t)}N4.exports=nJe});var j4=s(function(l$e,T4){"use strict";var L4=require("@stdlib/assert/is-plain-object"),R4=require("@stdlib/object/assign"),P4=require("@stdlib/string/format"),_4=$d();function aJe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!L4(r))throw new TypeError(P4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=R4({},r)}else if(t>2){if(!L4(i))throw new TypeError(P4("invalid argument. Options argument must be an object. Value: `%s`.",i));n=R4({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new _4(g,f,n)}function o(){return new _4(r,e,n)}}T4.exports=aJe});var G4=s(function(c$e,x4){"use strict";var M4=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lh=$d(),sJe=E4(),uJe=j4();M4(Lh,"objectMode",sJe);M4(Lh,"factory",uJe);x4.exports=Lh});var A4=s(function(m$e,oJe){oJe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var W4=s(function(h$e,F4){"use strict";var gJe=require("@stdlib/assert/is-plain-object"),jr=require("@stdlib/assert/has-own-property"),vJe=require("@stdlib/assert/is-boolean").isPrimitive,fJe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,V4=require("@stdlib/assert/is-string").isPrimitive,dJe=require("@stdlib/assert/is-positive-integer").isPrimitive,lJe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kn=require("@stdlib/string/format");function cJe(r,e){return gJe(e)?jr(e,"sep")&&(r.sep=e.sep,!V4(r.sep))?new TypeError(Kn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):jr(e,"objectMode")&&(r.objectMode=e.objectMode,!vJe(r.objectMode))?new TypeError(Kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):jr(e,"encoding")&&(r.encoding=e.encoding,!V4(r.encoding)&&r.encoding!==null)?new TypeError(Kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):jr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!fJe(r.highWaterMark))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):jr(e,"iter")&&(r.iter=e.iter,!lJe(r.iter))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):jr(e,"siter")&&(r.siter=e.siter,!dJe(r.siter))?new TypeError(Kn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(jr(e,"prng")&&(r.prng=e.prng),jr(e,"seed")&&(r.seed=e.seed),jr(e,"state")&&(r.state=e.state),jr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}F4.exports=cJe});var z4=s(function(p$e,I4){"use strict";var mJe=require("debug"),hJe=mJe("random:streams:weibull");I4.exports=hJe});var el=s(function(y$e,X4){"use strict";var B4=require("readable-stream").Readable,k4=require("@stdlib/assert/is-positive-number").isPrimitive,pJe=require("@stdlib/assert/is-error"),yJe=require("@stdlib/object/assign"),qJe=require("@stdlib/utils/inherit"),J4=require("@stdlib/utils/define-nonenumerable-property"),$i=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kd=require("@stdlib/utils/define-read-only-accessor"),bJe=require("@stdlib/utils/define-read-write-accessor"),wJe=Ea().factory,U4=require("@stdlib/buffer/from-string"),C4=require("@stdlib/string/format"),SJe=require("@stdlib/utils/next-tick"),OJe=A4(),NJe=W4(),ls=z4();function EJe(){return this._prng.seed}function LJe(){return this._prng.seedLength}function RJe(){return this._prng.stateLength}function PJe(){return this._prng.byteLength}function _Je(){return this._prng.state}function TJe(r){this._prng.state=r}function jJe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ls("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ls("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=U4(e):e=U4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function MJe(r){var e;if(this._destroyed)return ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,SJe(i),this;function i(){r&&(ls("Stream was destroyed due to an error. Error: %s.",pJe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ls("Closing the stream..."),e.emit("close")}}function ze(r,e,i){var t,n;if(!(this instanceof ze))return arguments.length>2?new ze(r,e,i):new ze(r,e);if(!k4(r))throw new TypeError(C4("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!k4(e))throw new TypeError(C4("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(t=yJe({},OJe),arguments.length>2&&(n=NJe(t,i),n))throw n;return ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),B4.call(this,t),J4(this,"_destroyed",!1),$i(this,"_objectMode",t.objectMode),$i(this,"_sep",t.sep),$i(this,"_iter",t.iter),$i(this,"_siter",t.siter),J4(this,"_i",0),$i(this,"_prng",wJe(r,e,t)),$i(this,"PRNG",this._prng.PRNG),this}qJe(ze,B4);Kd(ze.prototype,"seed",EJe);Kd(ze.prototype,"seedLength",LJe);bJe(ze.prototype,"state",_Je,TJe);Kd(ze.prototype,"stateLength",RJe);Kd(ze.prototype,"byteLength",PJe);$i(ze.prototype,"_read",jJe);$i(ze.prototype,"destroy",MJe);X4.exports=ze});var Y4=s(function(q$e,D4){"use strict";var xJe=require("@stdlib/assert/is-plain-object"),GJe=require("@stdlib/object/assign"),AJe=require("@stdlib/string/format"),VJe=el();function FJe(r,e,i){var t;if(arguments.length>2){if(t=i,!xJe(t))throw new TypeError(AJe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=GJe({},i)}else t={};return t.objectMode=!0,new VJe(r,e,t)}D4.exports=FJe});var eY=s(function(b$e,K4){"use strict";var H4=require("@stdlib/assert/is-plain-object"),Z4=require("@stdlib/object/assign"),Q4=require("@stdlib/string/format"),$4=el();function WJe(r,e,i){var t,n,a;if(t=arguments.length,t===1){if(!H4(r))throw new TypeError(Q4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Z4({},r)}else if(t>2){if(!H4(i))throw new TypeError(Q4("invalid argument. Options argument must be an object. Value: `%s`.",i));n=Z4({},i)}else n={};return t<2?a=u:a=o,a;function u(g,f){return new $4(g,f,n)}function o(){return new $4(r,e,n)}}K4.exports=WJe});var iY=s(function(w$e,tY){"use strict";var rY=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rh=el(),IJe=Y4(),zJe=eY();rY(Rh,"objectMode",IJe);rY(Rh,"factory",zJe);tY.exports=Rh});var aY=s(function(S$e,nY){"use strict";var T=require("@stdlib/utils/define-read-only-property"),P={};T(P,"arcsine",EI());T(P,"bernoulli",XI());T(P,"beta",mz());T(P,"betaprime",Wz());T(P,"binomial",sk());T(P,"boxMuller",Ok());T(P,"cauchy",Bk());T(P,"chi",d3());T(P,"chisquare",x3());T(P,"cosine",rJ());T(P,"discreteUniform",OJ());T(P,"erlang",BJ());T(P,"exponential",dU());T(P,"f",AU());T(P,"frechet",iC());T(P,"gamma",LC());T(P,"geometric",DC());T(P,"gumbel",mB());T(P,"hypergeometric",VB());T(P,"improvedZiggurat",KB());T(P,"invgamma",S9());T(P,"kumaraswamy",B9());T(P,"laplace",l8());T(P,"levy",A8());T(P,"logistic",iX());T(P,"lognormal",EX());T(P,"minstd",UX());T(P,"minstdShuffle",u7());T(P,"mt19937",E7());T(P,"negativeBinomial",D7());T(P,"normal",mD());T(P,"pareto1",WD());T(P,"poisson",a5());T(P,"randi",S5());T(P,"randn",I5());T(P,"randu",t6());T(P,"rayleigh",O6());T(P,"t",C6());T(P,"triangular",f4());T(P,"uniform",G4());T(P,"weibull",iY());nY.exports=P});var _h=s(function(O$e,uY){"use strict";var sY=require("@stdlib/array/base/assert/is-accessor-array"),Ph=en();function kJe(r,e,i,t,n,a,u,o){var g,f,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return sY(r)?f=r.get(i):f=r[i],sY(t)?m=t.get(a):m=t[a],g.fcn=Ph.factory(f,m,o),g;g.fcn=Ph.factory(o)}else g.fcn=Ph;return g.arity+=2,g}uY.exports=kJe});var gY=s(function(N$e,oY){"use strict";var JJe=require("@stdlib/strided/base/nullary"),UJe=require("@stdlib/strided/base/binary"),CJe=_h();function BJe(r,e,i,t,n,a,u,o){var g=CJe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(JJe([a],[r],[u],g.fcn),a):(UJe([e,t,a],[r],[i,n,u],g.fcn),a)}oY.exports=BJe});var fY=s(function(E$e,vY){"use strict";var XJe=require("@stdlib/strided/base/nullary").ndarray,DJe=require("@stdlib/strided/base/binary").ndarray,YJe=_h();function HJe(r,e,i,t,n,a,u,o,g,f,m){var c=YJe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(XJe([o],[r],[g],[f],c.fcn),o):(DJe([e,n,o],[r],[i,a,g],[t,u,f],c.fcn),o)}vY.exports=HJe});var cY=s(function(L$e,lY){"use strict";var ZJe=require("@stdlib/utils/define-nonenumerable-read-only-property"),dY=gY(),QJe=fY();ZJe(dY,"ndarray",QJe);lY.exports=dY});var jh=s(function(R$e,hY){"use strict";var mY=require("@stdlib/array/base/assert/is-accessor-array"),Th=tn();function $Je(r,e,i,t,n,a,u,o){var g,f,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return mY(r)?f=r.get(i):f=r[i],mY(t)?m=t.get(a):m=t[a],g.fcn=Th.factory(f,m,o),g;g.fcn=Th.factory(o)}else g.fcn=Th;return g.arity+=2,g}hY.exports=$Je});var yY=s(function(P$e,pY){"use strict";var KJe=require("@stdlib/strided/base/nullary"),eUe=require("@stdlib/strided/base/binary"),rUe=jh();function tUe(r,e,i,t,n,a,u,o){var g=rUe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(KJe([a],[r],[u],g.fcn),a):(eUe([e,t,a],[r],[i,n,u],g.fcn),a)}pY.exports=tUe});var bY=s(function(_$e,qY){"use strict";var iUe=require("@stdlib/strided/base/nullary").ndarray,nUe=require("@stdlib/strided/base/binary").ndarray,aUe=jh();function sUe(r,e,i,t,n,a,u,o,g,f,m){var c=aUe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(iUe([o],[r],[g],[f],c.fcn),o):(nUe([e,n,o],[r],[i,a,g],[t,u,f],c.fcn),o)}qY.exports=sUe});var OY=s(function(T$e,SY){"use strict";var uUe=require("@stdlib/utils/define-nonenumerable-read-only-property"),wY=yY(),oUe=bY();uUe(wY,"ndarray",oUe);SY.exports=wY});var xh=s(function(j$e,EY){"use strict";var NY=require("@stdlib/array/base/assert/is-accessor-array"),Mh=nn();function gUe(r,e,i,t,n,a,u,o){var g,f,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return NY(r)?f=r.get(i):f=r[i],NY(t)?m=t.get(a):m=t[a],g.fcn=Mh.factory(f,m,o),g;g.fcn=Mh.factory(o)}else g.fcn=Mh;return g.arity+=2,g}EY.exports=gUe});var RY=s(function(M$e,LY){"use strict";var vUe=require("@stdlib/strided/base/nullary"),fUe=require("@stdlib/strided/base/binary"),dUe=xh();function lUe(r,e,i,t,n,a,u,o){var g=dUe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(vUe([a],[r],[u],g.fcn),a):(fUe([e,t,a],[r],[i,n,u],g.fcn),a)}LY.exports=lUe});var _Y=s(function(x$e,PY){"use strict";var cUe=require("@stdlib/strided/base/nullary").ndarray,mUe=require("@stdlib/strided/base/binary").ndarray,hUe=xh();function pUe(r,e,i,t,n,a,u,o,g,f,m){var c=hUe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(cUe([o],[r],[g],[f],c.fcn),o):(mUe([e,n,o],[r],[i,a,g],[t,u,f],c.fcn),o)}PY.exports=pUe});var MY=s(function(G$e,jY){"use strict";var yUe=require("@stdlib/utils/define-nonenumerable-read-only-property"),TY=RY(),qUe=_Y();yUe(TY,"ndarray",qUe);jY.exports=TY});var Ah=s(function(A$e,GY){"use strict";var xY=require("@stdlib/array/base/assert/is-accessor-array"),Gh=an();function bUe(r,e,i,t,n,a,u,o){var g,f,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return xY(r)?f=r.get(i):f=r[i],xY(t)?m=t.get(a):m=t[a],g.fcn=Gh.factory(f,m,o),g;g.fcn=Gh.factory(o)}else g.fcn=Gh;return g.arity+=2,g}GY.exports=bUe});var VY=s(function(V$e,AY){"use strict";var wUe=require("@stdlib/strided/base/nullary"),SUe=require("@stdlib/strided/base/binary"),OUe=Ah();function NUe(r,e,i,t,n,a,u,o){var g=OUe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(wUe([a],[r],[u],g.fcn),a):(SUe([e,t,a],[r],[i,n,u],g.fcn),a)}AY.exports=NUe});var WY=s(function(F$e,FY){"use strict";var EUe=require("@stdlib/strided/base/nullary").ndarray,LUe=require("@stdlib/strided/base/binary").ndarray,RUe=Ah();function PUe(r,e,i,t,n,a,u,o,g,f,m){var c=RUe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(EUe([o],[r],[g],[f],c.fcn),o):(LUe([e,n,o],[r],[i,a,g],[t,u,f],c.fcn),o)}FY.exports=PUe});var kY=s(function(W$e,zY){"use strict";var _Ue=require("@stdlib/utils/define-nonenumerable-read-only-property"),IY=VY(),TUe=WY();_Ue(IY,"ndarray",TUe);zY.exports=IY});var Fh=s(function(I$e,UY){"use strict";var JY=require("@stdlib/array/base/assert/is-accessor-array"),Vh=sn();function jUe(r,e,i,t,n,a,u,o){var g,f,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return JY(r)?f=r.get(i):f=r[i],JY(t)?m=t.get(a):m=t[a],g.fcn=Vh.factory(f,m,o),g;g.fcn=Vh.factory(o)}else g.fcn=Vh;return g.arity+=2,g}UY.exports=jUe});var BY=s(function(z$e,CY){"use strict";var MUe=require("@stdlib/strided/base/nullary"),xUe=require("@stdlib/strided/base/binary"),GUe=Fh();function AUe(r,e,i,t,n,a,u,o){var g=GUe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(MUe([a],[r],[u],g.fcn),a):(xUe([e,t,a],[r],[i,n,u],g.fcn),a)}CY.exports=AUe});var DY=s(function(k$e,XY){"use strict";var VUe=require("@stdlib/strided/base/nullary").ndarray,FUe=require("@stdlib/strided/base/binary").ndarray,WUe=Fh();function IUe(r,e,i,t,n,a,u,o,g,f,m){var c=WUe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(VUe([o],[r],[g],[f],c.fcn),o):(FUe([e,n,o],[r],[i,a,g],[t,u,f],c.fcn),o)}XY.exports=IUe});var ZY=s(function(J$e,HY){"use strict";var zUe=require("@stdlib/utils/define-nonenumerable-read-only-property"),YY=BY(),kUe=DY();zUe(YY,"ndarray",kUe);HY.exports=YY});var Ih=s(function(U$e,QY){"use strict";var JUe=require("@stdlib/array/base/assert/is-accessor-array"),Wh=un();function UUe(r,e,i,t,n){var a,u;if(a={arity:0,fcn:null},t){if(e===0)return JUe(r)?u=r.get(i):u=r[i],a.fcn=Wh.factory(u,n),a;a.fcn=Wh.factory(n)}else a.fcn=Wh;return a.arity+=1,a}QY.exports=UUe});var KY=s(function(C$e,$Y){"use strict";var CUe=require("@stdlib/strided/base/nullary"),BUe=require("@stdlib/strided/base/unary"),XUe=Ih();function DUe(r,e,i,t,n,a){var u=XUe(e,i,0,arguments.length>5,a);return u.arity===0?(CUe([t],[r],[n],u.fcn),t):(BUe([e,t],[r],[i,n],u.fcn),t)}$Y.exports=DUe});var rH=s(function(B$e,eH){"use strict";var YUe=require("@stdlib/strided/base/nullary").ndarray,HUe=require("@stdlib/strided/base/unary").ndarray,ZUe=Ih();function QUe(r,e,i,t,n,a,u,o){var g=ZUe(e,i,t,arguments.length>7,o);return g.arity===0?(YUe([n],[r],[a],[u],g.fcn),n):(HUe([e,n],[r],[i,a],[t,u],g.fcn),n)}eH.exports=QUe});var nH=s(function(X$e,iH){"use strict";var $Ue=require("@stdlib/utils/define-nonenumerable-read-only-property"),tH=KY(),KUe=rH();$Ue(tH,"ndarray",KUe);iH.exports=tH});var kh=s(function(D$e,sH){"use strict";var aH=require("@stdlib/array/base/assert/is-accessor-array"),zh=ke();function eCe(r,e,i,t,n,a,u,o){var g,f,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return aH(r)?f=r.get(i):f=r[i],aH(t)?m=t.get(a):m=t[a],g.fcn=zh.factory(f,m,o),g;g.fcn=zh.factory(o)}else g.fcn=zh;return g.arity+=2,g}sH.exports=eCe});var oH=s(function(Y$e,uH){"use strict";var rCe=require("@stdlib/strided/base/nullary"),tCe=require("@stdlib/strided/base/binary"),iCe=kh();function nCe(r,e,i,t,n,a,u,o){var g=iCe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(rCe([a],[r],[u],g.fcn),a):(tCe([e,t,a],[r],[i,n,u],g.fcn),a)}uH.exports=nCe});var vH=s(function(H$e,gH){"use strict";var aCe=require("@stdlib/strided/base/nullary").ndarray,sCe=require("@stdlib/strided/base/binary").ndarray,uCe=kh();function oCe(r,e,i,t,n,a,u,o,g,f,m){var c=uCe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(aCe([o],[r],[g],[f],c.fcn),o):(sCe([e,n,o],[r],[i,a,g],[t,u,f],c.fcn),o)}gH.exports=oCe});var lH=s(function(Z$e,dH){"use strict";var gCe=require("@stdlib/utils/define-nonenumerable-read-only-property"),fH=oH(),vCe=vH();gCe(fH,"ndarray",vCe);dH.exports=fH});var Uh=s(function(Q$e,mH){"use strict";var cH=require("@stdlib/array/base/assert/is-accessor-array"),Jh=on();function fCe(r,e,i,t,n,a,u,o){var g,f,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return cH(r)?f=r.get(i):f=r[i],cH(t)?m=t.get(a):m=t[a],g.fcn=Jh.factory(f,m,o),g;g.fcn=Jh.factory(o)}else g.fcn=Jh;return g.arity+=2,g}mH.exports=fCe});var pH=s(function($$e,hH){"use strict";var dCe=require("@stdlib/strided/base/nullary"),lCe=require("@stdlib/strided/base/binary"),cCe=Uh();function mCe(r,e,i,t,n,a,u,o){var g=cCe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(dCe([a],[r],[u],g.fcn),a):(lCe([e,t,a],[r],[i,n,u],g.fcn),a)}hH.exports=mCe});var qH=s(function(K$e,yH){"use strict";var hCe=require("@stdlib/strided/base/nullary").ndarray,pCe=require("@stdlib/strided/base/binary").ndarray,yCe=Uh();function qCe(r,e,i,t,n,a,u,o,g,f,m){var c=yCe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(hCe([o],[r],[g],[f],c.fcn),o):(pCe([e,n,o],[r],[i,a,g],[t,u,f],c.fcn),o)}yH.exports=qCe});var SH=s(function(eKe,wH){"use strict";var bCe=require("@stdlib/utils/define-nonenumerable-read-only-property"),bH=pH(),wCe=qH();bCe(bH,"ndarray",wCe);wH.exports=bH});var Bh=s(function(rKe,NH){"use strict";var OH=require("@stdlib/array/base/assert/is-accessor-array"),Ch=gn();function SCe(r,e,i,t,n,a,u,o){var g,f,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return OH(r)?f=r.get(i):f=r[i],OH(t)?m=t.get(a):m=t[a],g.fcn=Ch.factory(f,m,o),g;g.fcn=Ch.factory(o)}else g.fcn=Ch;return g.arity+=2,g}NH.exports=SCe});var LH=s(function(tKe,EH){"use strict";var OCe=require("@stdlib/strided/base/nullary"),NCe=require("@stdlib/strided/base/binary"),ECe=Bh();function LCe(r,e,i,t,n,a,u,o){var g=ECe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(OCe([a],[r],[u],g.fcn),a):(NCe([e,t,a],[r],[i,n,u],g.fcn),a)}EH.exports=LCe});var PH=s(function(iKe,RH){"use strict";var RCe=require("@stdlib/strided/base/nullary").ndarray,PCe=require("@stdlib/strided/base/binary").ndarray,_Ce=Bh();function TCe(r,e,i,t,n,a,u,o,g,f,m){var c=_Ce(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(RCe([o],[r],[g],[f],c.fcn),o):(PCe([e,n,o],[r],[i,a,g],[t,u,f],c.fcn),o)}RH.exports=TCe});var jH=s(function(nKe,TH){"use strict";var jCe=require("@stdlib/utils/define-nonenumerable-read-only-property"),_H=LH(),MCe=PH();jCe(_H,"ndarray",MCe);TH.exports=_H});var GH=s(function(aKe,xH){"use strict";var xCe=require("@stdlib/strided/base/nullary"),MH=Z();function GCe(r,e,i,t){var n;return arguments.length>3?n=MH.factory(t):n=MH,xCe([e],[r],[i],n),e}xH.exports=GCe});var FH=s(function(sKe,VH){"use strict";var ACe=require("@stdlib/strided/base/nullary").ndarray,AH=Z();function VCe(r,e,i,t,n){var a;return arguments.length>4?a=AH.factory(n):a=AH,ACe([e],[r],[i],[t],a),e}VH.exports=VCe});var zH=s(function(uKe,IH){"use strict";var FCe=require("@stdlib/strided/base/nullary"),WH=Z();function WCe(r,e,i,t){var n;return arguments.length>3?n=WH.factory(t):n=WH,FCe([e],[r],[i],n.normalized),e}IH.exports=WCe});var UH=s(function(oKe,JH){"use strict";var ICe=require("@stdlib/strided/base/nullary").ndarray,kH=Z();function zCe(r,e,i,t,n){var a;return arguments.length>4?a=kH.factory(n):a=kH,ICe([e],[r],[i],[t],a.normalized),e}JH.exports=zCe});var XH=s(function(gKe,BH){"use strict";var Xh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dh=GH(),kCe=FH(),CH=zH(),JCe=UH();Xh(Dh,"ndarray",kCe);Xh(Dh,"normalized",CH);Xh(CH,"ndarray",JCe);BH.exports=Dh});var HH=s(function(vKe,YH){"use strict";var UCe=require("@stdlib/strided/base/nullary"),DH=$();function CCe(r,e,i,t){var n;return arguments.length>3?n=DH.factory(t):n=DH,UCe([e],[r],[i],n),e}YH.exports=CCe});var $H=s(function(fKe,QH){"use strict";var BCe=require("@stdlib/strided/base/nullary").ndarray,ZH=$();function XCe(r,e,i,t,n){var a;return arguments.length>4?a=ZH.factory(n):a=ZH,BCe([e],[r],[i],[t],a),e}QH.exports=XCe});var rZ=s(function(dKe,eZ){"use strict";var DCe=require("@stdlib/strided/base/nullary"),KH=$();function YCe(r,e,i,t){var n;return arguments.length>3?n=KH.factory(t):n=KH,DCe([e],[r],[i],n.normalized),e}eZ.exports=YCe});var nZ=s(function(lKe,iZ){"use strict";var HCe=require("@stdlib/strided/base/nullary").ndarray,tZ=$();function ZCe(r,e,i,t,n){var a;return arguments.length>4?a=tZ.factory(n):a=tZ,HCe([e],[r],[i],[t],a.normalized),e}iZ.exports=ZCe});var uZ=s(function(cKe,sZ){"use strict";var Yh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hh=HH(),QCe=$H(),aZ=rZ(),$Ce=nZ();Yh(Hh,"ndarray",QCe);Yh(Hh,"normalized",aZ);Yh(aZ,"ndarray",$Ce);sZ.exports=Hh});var vZ=s(function(mKe,gZ){"use strict";var KCe=require("@stdlib/strided/base/nullary"),oZ=j();function eBe(r,e,i,t){var n;return arguments.length>3?n=oZ.factory(t):n=oZ,KCe([e],[r],[i],n),e}gZ.exports=eBe});var lZ=s(function(hKe,dZ){"use strict";var rBe=require("@stdlib/strided/base/nullary").ndarray,fZ=j();function tBe(r,e,i,t,n){var a;return arguments.length>4?a=fZ.factory(n):a=fZ,rBe([e],[r],[i],[t],a),e}dZ.exports=tBe});var hZ=s(function(pKe,mZ){"use strict";var iBe=require("@stdlib/strided/base/nullary"),cZ=j();function nBe(r,e,i,t){var n;return arguments.length>3?n=cZ.factory(t):n=cZ,iBe([e],[r],[i],n.normalized),e}mZ.exports=nBe});var qZ=s(function(yKe,yZ){"use strict";var aBe=require("@stdlib/strided/base/nullary").ndarray,pZ=j();function sBe(r,e,i,t,n){var a;return arguments.length>4?a=pZ.factory(n):a=pZ,aBe([e],[r],[i],[t],a.normalized),e}yZ.exports=sBe});var SZ=s(function(qKe,wZ){"use strict";var Zh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qh=vZ(),uBe=lZ(),bZ=hZ(),oBe=qZ();Zh(Qh,"ndarray",uBe);Zh(Qh,"normalized",bZ);Zh(bZ,"ndarray",oBe);wZ.exports=Qh});var Kh=s(function(bKe,NZ){"use strict";var OZ=require("@stdlib/array/base/assert/is-accessor-array"),$h=vn();function gBe(r,e,i,t,n,a,u,o){var g,f,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return OZ(r)?f=r.get(i):f=r[i],OZ(t)?m=t.get(a):m=t[a],g.fcn=$h.factory(f,m,o),g;g.fcn=$h.factory(o)}else g.fcn=$h;return g.arity+=2,g}NZ.exports=gBe});var LZ=s(function(wKe,EZ){"use strict";var vBe=require("@stdlib/strided/base/nullary"),fBe=require("@stdlib/strided/base/binary"),dBe=Kh();function lBe(r,e,i,t,n,a,u,o){var g=dBe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(vBe([a],[r],[u],g.fcn),a):(fBe([e,t,a],[r],[i,n,u],g.fcn),a)}EZ.exports=lBe});var PZ=s(function(SKe,RZ){"use strict";var cBe=require("@stdlib/strided/base/nullary").ndarray,mBe=require("@stdlib/strided/base/binary").ndarray,hBe=Kh();function pBe(r,e,i,t,n,a,u,o,g,f,m){var c=hBe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(cBe([o],[r],[g],[f],c.fcn),o):(mBe([e,n,o],[r],[i,a,g],[t,u,f],c.fcn),o)}RZ.exports=pBe});var jZ=s(function(OKe,TZ){"use strict";var yBe=require("@stdlib/utils/define-nonenumerable-read-only-property"),_Z=LZ(),qBe=PZ();yBe(_Z,"ndarray",qBe);TZ.exports=_Z});var GZ=s(function(NKe,xZ){"use strict";var bBe=require("@stdlib/strided/base/nullary"),MZ=bt();function wBe(r,e,i,t){var n;return arguments.length>3?n=MZ.factory(t):n=MZ,bBe([e],[r],[i],n),e}xZ.exports=wBe});var FZ=s(function(EKe,VZ){"use strict";var SBe=require("@stdlib/strided/base/nullary").ndarray,AZ=bt();function OBe(r,e,i,t,n){var a;return arguments.length>4?a=AZ.factory(n):a=AZ,SBe([e],[r],[i],[t],a),e}VZ.exports=OBe});var zZ=s(function(LKe,IZ){"use strict";var NBe=require("@stdlib/utils/define-nonenumerable-read-only-property"),WZ=GZ(),EBe=FZ();NBe(WZ,"ndarray",EBe);IZ.exports=WZ});var rp=s(function(RKe,JZ){"use strict";var kZ=require("@stdlib/array/base/assert/is-accessor-array"),ep=fn();function LBe(r,e,i,t,n,a,u,o){var g,f,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return kZ(r)?f=r.get(i):f=r[i],kZ(t)?m=t.get(a):m=t[a],g.fcn=ep.factory(f,m,o),g;g.fcn=ep.factory(o)}else g.fcn=ep;return g.arity+=2,g}JZ.exports=LBe});var CZ=s(function(PKe,UZ){"use strict";var RBe=require("@stdlib/strided/base/nullary"),PBe=require("@stdlib/strided/base/binary"),_Be=rp();function TBe(r,e,i,t,n,a,u,o){var g=_Be(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(RBe([a],[r],[u],g.fcn),a):(PBe([e,t,a],[r],[i,n,u],g.fcn),a)}UZ.exports=TBe});var XZ=s(function(_Ke,BZ){"use strict";var jBe=require("@stdlib/strided/base/nullary").ndarray,MBe=require("@stdlib/strided/base/binary").ndarray,xBe=rp();function GBe(r,e,i,t,n,a,u,o,g,f,m){var c=xBe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(jBe([o],[r],[g],[f],c.fcn),o):(MBe([e,n,o],[r],[i,a,g],[t,u,f],c.fcn),o)}BZ.exports=GBe});var HZ=s(function(TKe,YZ){"use strict";var ABe=require("@stdlib/utils/define-nonenumerable-read-only-property"),DZ=CZ(),VBe=XZ();ABe(DZ,"ndarray",VBe);YZ.exports=DZ});var ip=s(function(jKe,QZ){"use strict";var ZZ=require("@stdlib/array/base/assert/is-accessor-array"),tp=Ea();function FBe(r,e,i,t,n,a,u,o){var g,f,m;if(g={arity:0,fcn:null},u){if(e===0&&n===0)return ZZ(r)?f=r.get(i):f=r[i],ZZ(t)?m=t.get(a):m=t[a],g.fcn=tp.factory(f,m,o),g;g.fcn=tp.factory(o)}else g.fcn=tp;return g.arity+=2,g}QZ.exports=FBe});var KZ=s(function(MKe,$Z){"use strict";var WBe=require("@stdlib/strided/base/nullary"),IBe=require("@stdlib/strided/base/binary"),zBe=ip();function kBe(r,e,i,t,n,a,u,o){var g=zBe(e,i,0,t,n,0,arguments.length>7,o);return g.arity===0?(WBe([a],[r],[u],g.fcn),a):(IBe([e,t,a],[r],[i,n,u],g.fcn),a)}$Z.exports=kBe});var rQ=s(function(xKe,eQ){"use strict";var JBe=require("@stdlib/strided/base/nullary").ndarray,UBe=require("@stdlib/strided/base/binary").ndarray,CBe=ip();function BBe(r,e,i,t,n,a,u,o,g,f,m){var c=CBe(e,i,t,n,a,u,arguments.length>10,m);return c.arity===0?(JBe([o],[r],[g],[f],c.fcn),o):(UBe([e,n,o],[r],[i,a,g],[t,u,f],c.fcn),o)}eQ.exports=BBe});var nQ=s(function(GKe,iQ){"use strict";var XBe=require("@stdlib/utils/define-nonenumerable-read-only-property"),tQ=KZ(),DBe=rQ();XBe(tQ,"ndarray",DBe);iQ.exports=tQ});var sQ=s(function(AKe,aQ){"use strict";var W=require("@stdlib/utils/define-read-only-property"),V={};W(V,"arcsine",cY());W(V,"beta",OY());W(V,"betaprime",MY());W(V,"cosine",kY());W(V,"discreteUniform",ZY());W(V,"exponential",nH());W(V,"gamma",lH());W(V,"invgamma",SH());W(V,"lognormal",jH());W(V,"minstd",XH());W(V,"minstdShuffle",uZ());W(V,"mt19937",SZ());W(V,"normal",jZ());W(V,"randu",zZ());W(V,"uniform",HZ());W(V,"weibull",nQ());aQ.exports=V});var ea=require("@stdlib/utils/define-read-only-property"),Ki={};ea(Ki,"array",rR());ea(Ki,"base",o1());ea(Ki,"iterators",yW());ea(Ki,"sample",JW());ea(Ki,"shuffle",tI());ea(Ki,"streams",aY());ea(Ki,"strided",sQ());module.exports=Ki; /** * @license Apache-2.0 * diff --git a/dist/index.js.map b/dist/index.js.map index a1c926a3..9378038c 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../base/mt19937/lib/rand_uint32.js", "../base/mt19937/lib/factory.js", "../base/mt19937/lib/main.js", "../base/mt19937/lib/index.js", "../base/arcsine/lib/validate.js", "../base/arcsine/lib/arcsine.js", "../base/arcsine/lib/factory.js", "../base/arcsine/lib/main.js", "../base/arcsine/lib/index.js", "../array/arcsine/lib/defaults.json", "../array/arcsine/lib/validate.js", "../array/arcsine/lib/factory.js", "../array/arcsine/lib/main.js", "../array/arcsine/lib/index.js", "../base/improved-ziggurat/lib/coords_array.js", "../base/improved-ziggurat/lib/ratio_array.js", "../base/improved-ziggurat/lib/sample_tail.js", "../base/improved-ziggurat/lib/improved_ziggurat.js", "../base/improved-ziggurat/lib/factory.js", "../base/improved-ziggurat/lib/main.js", "../base/improved-ziggurat/lib/index.js", "../base/beta/lib/validate.js", "../base/beta/lib/standard_gamma.js", "../base/beta/lib/sample1.js", "../base/beta/lib/sample2.js", "../base/beta/lib/sample3.js", "../base/beta/lib/beta.js", "../base/beta/lib/factory.js", "../base/beta/lib/main.js", "../base/beta/lib/index.js", "../array/beta/lib/defaults.json", "../array/beta/lib/validate.js", "../array/beta/lib/factory.js", "../array/beta/lib/main.js", "../array/beta/lib/index.js", "../base/gamma/lib/validate.js", "../base/gamma/lib/gamma.js", "../base/gamma/lib/factory.js", "../base/gamma/lib/main.js", "../base/gamma/lib/index.js", "../base/betaprime/lib/validate.js", "../base/betaprime/lib/betaprime.js", "../base/betaprime/lib/factory.js", "../base/betaprime/lib/main.js", "../base/betaprime/lib/index.js", "../array/betaprime/lib/defaults.json", "../array/betaprime/lib/validate.js", "../array/betaprime/lib/factory.js", "../array/betaprime/lib/main.js", "../array/betaprime/lib/index.js", "../base/cosine/lib/validate.js", "../base/cosine/lib/cosine.js", "../base/cosine/lib/factory.js", "../base/cosine/lib/main.js", "../base/cosine/lib/index.js", "../array/cosine/lib/defaults.json", "../array/cosine/lib/validate.js", "../array/cosine/lib/factory.js", "../array/cosine/lib/main.js", "../array/cosine/lib/index.js", "../base/discrete-uniform/lib/validate.js", "../base/discrete-uniform/lib/discrete_uniform.js", "../base/discrete-uniform/lib/factory.js", "../base/discrete-uniform/lib/main.js", "../base/discrete-uniform/lib/index.js", "../array/discrete-uniform/lib/defaults.json", "../array/discrete-uniform/lib/validate.js", "../array/discrete-uniform/lib/factory.js", "../array/discrete-uniform/lib/main.js", "../array/discrete-uniform/lib/index.js", "../base/exponential/lib/exponential.js", "../base/exponential/lib/factory.js", "../base/exponential/lib/main.js", "../base/exponential/lib/index.js", "../array/exponential/lib/defaults.json", "../array/exponential/lib/validate.js", "../array/exponential/lib/factory.js", "../array/exponential/lib/main.js", "../array/exponential/lib/index.js", "../array/gamma/lib/defaults.json", "../array/gamma/lib/validate.js", "../array/gamma/lib/factory.js", "../array/gamma/lib/main.js", "../array/gamma/lib/index.js", "../base/geometric/lib/geometric.js", "../base/geometric/lib/factory.js", "../base/geometric/lib/main.js", "../base/geometric/lib/index.js", "../array/geometric/lib/defaults.json", "../array/geometric/lib/validate.js", "../array/geometric/lib/factory.js", "../array/geometric/lib/main.js", "../array/geometric/lib/index.js", "../base/invgamma/lib/validate.js", "../base/invgamma/lib/factory.js", "../base/invgamma/lib/main.js", "../base/invgamma/lib/index.js", "../array/invgamma/lib/defaults.json", "../array/invgamma/lib/validate.js", "../array/invgamma/lib/factory.js", "../array/invgamma/lib/main.js", "../array/invgamma/lib/index.js", "../base/lognormal/lib/validate.js", "../base/lognormal/lib/lognormal.js", "../base/lognormal/lib/factory.js", "../base/lognormal/lib/main.js", "../base/lognormal/lib/index.js", "../array/lognormal/lib/defaults.json", "../array/lognormal/lib/validate.js", "../array/lognormal/lib/factory.js", "../array/lognormal/lib/main.js", "../array/lognormal/lib/index.js", "../base/minstd/lib/rand_int32.js", "../base/minstd/lib/factory.js", "../base/minstd/lib/main.js", "../base/minstd/lib/index.js", "../array/minstd/lib/defaults.json", "../array/minstd/lib/validate.js", "../array/minstd/lib/factory.js", "../array/minstd/lib/main.js", "../array/minstd/lib/index.js", "../base/minstd-shuffle/lib/create_table.js", "../base/minstd-shuffle/lib/rand_int32.js", "../base/minstd-shuffle/lib/factory.js", "../base/minstd-shuffle/lib/main.js", "../base/minstd-shuffle/lib/index.js", "../array/minstd-shuffle/lib/defaults.json", "../array/minstd-shuffle/lib/validate.js", "../array/minstd-shuffle/lib/factory.js", "../array/minstd-shuffle/lib/main.js", "../array/minstd-shuffle/lib/index.js", "../array/mt19937/lib/defaults.json", "../array/mt19937/lib/validate.js", "../array/mt19937/lib/factory.js", "../array/mt19937/lib/main.js", "../array/mt19937/lib/index.js", "../base/normal/lib/validate.js", "../base/normal/lib/normal.js", "../base/normal/lib/factory.js", "../base/normal/lib/main.js", "../base/normal/lib/index.js", "../array/normal/lib/defaults.json", "../array/normal/lib/validate.js", "../array/normal/lib/factory.js", "../array/normal/lib/main.js", "../array/normal/lib/index.js", "../base/randu/lib/defaults.json", "../base/randu/lib/prngs.js", "../base/randu/lib/factory.js", "../base/randu/lib/main.js", "../base/randu/lib/index.js", "../array/randu/lib/defaults.json", "../array/randu/lib/validate.js", "../array/randu/lib/factory.js", "../array/randu/lib/main.js", "../array/randu/lib/index.js", "../base/uniform/lib/validate.js", "../base/uniform/lib/uniform.js", "../base/uniform/lib/factory.js", "../base/uniform/lib/main.js", "../base/uniform/lib/index.js", "../array/uniform/lib/defaults.json", "../array/uniform/lib/validate.js", "../array/uniform/lib/factory.js", "../array/uniform/lib/main.js", "../array/uniform/lib/index.js", "../array/lib/index.js", "../base/bernoulli/lib/factory.js", "../base/bernoulli/lib/main.js", "../base/bernoulli/lib/index.js", "../base/binomial/lib/validate.js", "../base/binomial/lib/sample1.js", "../base/binomial/lib/correction.js", "../base/binomial/lib/sample2.js", "../base/binomial/lib/binomial.js", "../base/binomial/lib/factory.js", "../base/binomial/lib/main.js", "../base/binomial/lib/index.js", "../base/box-muller/lib/randn.js", "../base/box-muller/lib/min.js", "../base/box-muller/lib/max.js", "../base/box-muller/lib/factory.js", "../base/box-muller/lib/main.js", "../base/box-muller/lib/index.js", "../base/cauchy/lib/validate.js", "../base/cauchy/lib/cauchy.js", "../base/cauchy/lib/factory.js", "../base/cauchy/lib/main.js", "../base/cauchy/lib/index.js", "../base/chisquare/lib/factory.js", "../base/chisquare/lib/main.js", "../base/chisquare/lib/index.js", "../base/chi/lib/factory.js", "../base/chi/lib/main.js", "../base/chi/lib/index.js", "../base/erlang/lib/validate.js", "../base/erlang/lib/erlang.js", "../base/erlang/lib/factory.js", "../base/erlang/lib/main.js", "../base/erlang/lib/index.js", "../base/f/lib/validate.js", "../base/f/lib/f.js", "../base/f/lib/factory.js", "../base/f/lib/main.js", "../base/f/lib/index.js", "../base/frechet/lib/validate.js", "../base/frechet/lib/frechet.js", "../base/frechet/lib/factory.js", "../base/frechet/lib/main.js", "../base/frechet/lib/index.js", "../base/gumbel/lib/validate.js", "../base/gumbel/lib/gumbel.js", "../base/gumbel/lib/factory.js", "../base/gumbel/lib/main.js", "../base/gumbel/lib/index.js", "../base/hypergeometric/lib/validate.js", "../base/hypergeometric/lib/hin.js", "../base/hypergeometric/lib/hypergeometric.js", "../base/hypergeometric/lib/factory.js", "../base/hypergeometric/lib/main.js", "../base/hypergeometric/lib/index.js", "../base/kumaraswamy/lib/validate.js", "../base/kumaraswamy/lib/kumaraswamy.js", "../base/kumaraswamy/lib/factory.js", "../base/kumaraswamy/lib/main.js", "../base/kumaraswamy/lib/index.js", "../base/laplace/lib/validate.js", "../base/laplace/lib/laplace.js", "../base/laplace/lib/factory.js", "../base/laplace/lib/main.js", "../base/laplace/lib/index.js", "../base/levy/lib/validate.js", "../base/levy/lib/levy.js", "../base/levy/lib/factory.js", "../base/levy/lib/main.js", "../base/levy/lib/index.js", "../base/logistic/lib/validate.js", "../base/logistic/lib/logistic.js", "../base/logistic/lib/factory.js", "../base/logistic/lib/main.js", "../base/logistic/lib/index.js", "../base/poisson/lib/knuth.js", "../base/poisson/lib/rejection.js", "../base/poisson/lib/poisson.js", "../base/poisson/lib/factory.js", "../base/poisson/lib/main.js", "../base/poisson/lib/index.js", "../base/negative-binomial/lib/validate.js", "../base/negative-binomial/lib/factory.js", "../base/negative-binomial/lib/main.js", "../base/negative-binomial/lib/index.js", "../base/pareto-type1/lib/validate.js", "../base/pareto-type1/lib/pareto.js", "../base/pareto-type1/lib/factory.js", "../base/pareto-type1/lib/main.js", "../base/pareto-type1/lib/index.js", "../base/randi/lib/defaults.json", "../base/randi/lib/prngs.js", "../base/randi/lib/factory.js", "../base/randi/lib/main.js", "../base/randi/lib/index.js", "../base/randn/lib/defaults.json", "../base/randn/lib/prngs.js", "../base/randn/lib/factory.js", "../base/randn/lib/main.js", "../base/randn/lib/index.js", "../base/rayleigh/lib/rayleigh.js", "../base/rayleigh/lib/factory.js", "../base/rayleigh/lib/main.js", "../base/rayleigh/lib/index.js", "../base/t/lib/factory.js", "../base/t/lib/main.js", "../base/t/lib/index.js", "../base/triangular/lib/validate.js", "../base/triangular/lib/triangular.js", "../base/triangular/lib/factory.js", "../base/triangular/lib/main.js", "../base/triangular/lib/index.js", "../base/weibull/lib/validate.js", "../base/weibull/lib/weibull.js", "../base/weibull/lib/factory.js", "../base/weibull/lib/main.js", "../base/weibull/lib/index.js", "../base/reviver/lib/prngs.js", "../base/reviver/lib/main.js", "../base/reviver/lib/index.js", "../base/lib/index.js", "../iter/arcsine/lib/main.js", "../iter/arcsine/lib/index.js", "../iter/bernoulli/lib/main.js", "../iter/bernoulli/lib/index.js", "../iter/beta/lib/main.js", "../iter/beta/lib/index.js", "../iter/betaprime/lib/main.js", "../iter/betaprime/lib/index.js", "../iter/binomial/lib/main.js", "../iter/binomial/lib/index.js", "../iter/box-muller/lib/main.js", "../iter/box-muller/lib/index.js", "../iter/cauchy/lib/main.js", "../iter/cauchy/lib/index.js", "../iter/chi/lib/main.js", "../iter/chi/lib/index.js", "../iter/chisquare/lib/main.js", "../iter/chisquare/lib/index.js", "../iter/cosine/lib/main.js", "../iter/cosine/lib/index.js", "../iter/discrete-uniform/lib/main.js", "../iter/discrete-uniform/lib/index.js", "../iter/erlang/lib/main.js", "../iter/erlang/lib/index.js", "../iter/exponential/lib/main.js", "../iter/exponential/lib/index.js", "../iter/f/lib/main.js", "../iter/f/lib/index.js", "../iter/frechet/lib/main.js", "../iter/frechet/lib/index.js", "../iter/gamma/lib/main.js", "../iter/gamma/lib/index.js", "../iter/geometric/lib/main.js", "../iter/geometric/lib/index.js", "../iter/gumbel/lib/main.js", "../iter/gumbel/lib/index.js", "../iter/hypergeometric/lib/main.js", "../iter/hypergeometric/lib/index.js", "../iter/improved-ziggurat/lib/main.js", "../iter/improved-ziggurat/lib/index.js", "../iter/invgamma/lib/main.js", "../iter/invgamma/lib/index.js", "../iter/kumaraswamy/lib/main.js", "../iter/kumaraswamy/lib/index.js", "../iter/laplace/lib/main.js", "../iter/laplace/lib/index.js", "../iter/levy/lib/main.js", "../iter/levy/lib/index.js", "../iter/logistic/lib/main.js", "../iter/logistic/lib/index.js", "../iter/lognormal/lib/main.js", "../iter/lognormal/lib/index.js", "../iter/minstd/lib/main.js", "../iter/minstd/lib/index.js", "../iter/minstd-shuffle/lib/main.js", "../iter/minstd-shuffle/lib/index.js", "../iter/mt19937/lib/main.js", "../iter/mt19937/lib/index.js", "../iter/negative-binomial/lib/main.js", "../iter/negative-binomial/lib/index.js", "../iter/normal/lib/main.js", "../iter/normal/lib/index.js", "../iter/pareto-type1/lib/main.js", "../iter/pareto-type1/lib/index.js", "../iter/poisson/lib/main.js", "../iter/poisson/lib/index.js", "../iter/randi/lib/main.js", "../iter/randi/lib/index.js", "../iter/randn/lib/main.js", "../iter/randn/lib/index.js", "../iter/randu/lib/main.js", "../iter/randu/lib/index.js", "../iter/rayleigh/lib/main.js", "../iter/rayleigh/lib/index.js", "../iter/t/lib/main.js", "../iter/t/lib/index.js", "../iter/triangular/lib/main.js", "../iter/triangular/lib/index.js", "../iter/uniform/lib/main.js", "../iter/uniform/lib/index.js", "../iter/weibull/lib/main.js", "../iter/weibull/lib/index.js", "../iter/lib/index.js", "../sample/lib/discrete_uniform.js", "../sample/lib/renormalizing.js", "../sample/lib/fisher_yates.js", "../sample/lib/vose.js", "../sample/lib/defaults.json", "../sample/lib/validate.js", "../sample/lib/factory.js", "../sample/lib/main.js", "../sample/lib/index.js", "../shuffle/lib/defaults.json", "../shuffle/lib/validate.js", "../shuffle/lib/factory.js", "../shuffle/lib/main.js", "../shuffle/lib/index.js", "../streams/arcsine/lib/defaults.json", "../streams/arcsine/lib/validate.js", "../streams/arcsine/lib/debug.js", "../streams/arcsine/lib/main.js", "../streams/arcsine/lib/object_mode.js", "../streams/arcsine/lib/factory.js", "../streams/arcsine/lib/index.js", "../streams/bernoulli/lib/defaults.json", "../streams/bernoulli/lib/validate.js", "../streams/bernoulli/lib/debug.js", "../streams/bernoulli/lib/main.js", "../streams/bernoulli/lib/object_mode.js", "../streams/bernoulli/lib/factory.js", "../streams/bernoulli/lib/index.js", "../streams/beta/lib/defaults.json", "../streams/beta/lib/validate.js", "../streams/beta/lib/debug.js", "../streams/beta/lib/main.js", "../streams/beta/lib/object_mode.js", "../streams/beta/lib/factory.js", "../streams/beta/lib/index.js", "../streams/betaprime/lib/defaults.json", "../streams/betaprime/lib/validate.js", "../streams/betaprime/lib/debug.js", "../streams/betaprime/lib/main.js", "../streams/betaprime/lib/object_mode.js", "../streams/betaprime/lib/factory.js", "../streams/betaprime/lib/index.js", "../streams/binomial/lib/defaults.json", "../streams/binomial/lib/validate.js", "../streams/binomial/lib/debug.js", "../streams/binomial/lib/main.js", "../streams/binomial/lib/object_mode.js", "../streams/binomial/lib/factory.js", "../streams/binomial/lib/index.js", "../streams/box-muller/lib/defaults.json", "../streams/box-muller/lib/validate.js", "../streams/box-muller/lib/debug.js", "../streams/box-muller/lib/main.js", "../streams/box-muller/lib/object_mode.js", "../streams/box-muller/lib/factory.js", "../streams/box-muller/lib/index.js", "../streams/cauchy/lib/defaults.json", "../streams/cauchy/lib/validate.js", "../streams/cauchy/lib/debug.js", "../streams/cauchy/lib/main.js", "../streams/cauchy/lib/object_mode.js", "../streams/cauchy/lib/factory.js", "../streams/cauchy/lib/index.js", "../streams/chi/lib/defaults.json", "../streams/chi/lib/validate.js", "../streams/chi/lib/debug.js", "../streams/chi/lib/main.js", "../streams/chi/lib/object_mode.js", "../streams/chi/lib/factory.js", "../streams/chi/lib/index.js", "../streams/chisquare/lib/defaults.json", "../streams/chisquare/lib/validate.js", "../streams/chisquare/lib/debug.js", "../streams/chisquare/lib/main.js", "../streams/chisquare/lib/object_mode.js", "../streams/chisquare/lib/factory.js", "../streams/chisquare/lib/index.js", "../streams/cosine/lib/defaults.json", "../streams/cosine/lib/validate.js", "../streams/cosine/lib/debug.js", "../streams/cosine/lib/main.js", "../streams/cosine/lib/object_mode.js", "../streams/cosine/lib/factory.js", "../streams/cosine/lib/index.js", "../streams/discrete-uniform/lib/defaults.json", "../streams/discrete-uniform/lib/validate.js", "../streams/discrete-uniform/lib/debug.js", "../streams/discrete-uniform/lib/main.js", "../streams/discrete-uniform/lib/object_mode.js", "../streams/discrete-uniform/lib/factory.js", "../streams/discrete-uniform/lib/index.js", "../streams/erlang/lib/defaults.json", "../streams/erlang/lib/validate.js", "../streams/erlang/lib/debug.js", "../streams/erlang/lib/main.js", "../streams/erlang/lib/object_mode.js", "../streams/erlang/lib/factory.js", "../streams/erlang/lib/index.js", "../streams/exponential/lib/defaults.json", "../streams/exponential/lib/validate.js", "../streams/exponential/lib/debug.js", "../streams/exponential/lib/main.js", "../streams/exponential/lib/object_mode.js", "../streams/exponential/lib/factory.js", "../streams/exponential/lib/index.js", "../streams/f/lib/defaults.json", "../streams/f/lib/validate.js", "../streams/f/lib/debug.js", "../streams/f/lib/main.js", "../streams/f/lib/object_mode.js", "../streams/f/lib/factory.js", "../streams/f/lib/index.js", "../streams/frechet/lib/defaults.json", "../streams/frechet/lib/validate.js", "../streams/frechet/lib/debug.js", "../streams/frechet/lib/main.js", "../streams/frechet/lib/object_mode.js", "../streams/frechet/lib/factory.js", "../streams/frechet/lib/index.js", "../streams/gamma/lib/defaults.json", "../streams/gamma/lib/validate.js", "../streams/gamma/lib/debug.js", "../streams/gamma/lib/main.js", "../streams/gamma/lib/object_mode.js", "../streams/gamma/lib/factory.js", "../streams/gamma/lib/index.js", "../streams/geometric/lib/defaults.json", "../streams/geometric/lib/validate.js", "../streams/geometric/lib/debug.js", "../streams/geometric/lib/main.js", "../streams/geometric/lib/object_mode.js", "../streams/geometric/lib/factory.js", "../streams/geometric/lib/index.js", "../streams/gumbel/lib/defaults.json", "../streams/gumbel/lib/validate.js", "../streams/gumbel/lib/debug.js", "../streams/gumbel/lib/main.js", "../streams/gumbel/lib/object_mode.js", "../streams/gumbel/lib/factory.js", "../streams/gumbel/lib/index.js", "../streams/hypergeometric/lib/defaults.json", "../streams/hypergeometric/lib/validate.js", "../streams/hypergeometric/lib/debug.js", "../streams/hypergeometric/lib/main.js", "../streams/hypergeometric/lib/object_mode.js", "../streams/hypergeometric/lib/factory.js", "../streams/hypergeometric/lib/index.js", "../streams/improved-ziggurat/lib/defaults.json", "../streams/improved-ziggurat/lib/validate.js", "../streams/improved-ziggurat/lib/debug.js", "../streams/improved-ziggurat/lib/main.js", "../streams/improved-ziggurat/lib/object_mode.js", "../streams/improved-ziggurat/lib/factory.js", "../streams/improved-ziggurat/lib/index.js", "../streams/invgamma/lib/defaults.json", "../streams/invgamma/lib/validate.js", "../streams/invgamma/lib/debug.js", "../streams/invgamma/lib/main.js", "../streams/invgamma/lib/object_mode.js", "../streams/invgamma/lib/factory.js", "../streams/invgamma/lib/index.js", "../streams/kumaraswamy/lib/defaults.json", "../streams/kumaraswamy/lib/validate.js", "../streams/kumaraswamy/lib/debug.js", "../streams/kumaraswamy/lib/main.js", "../streams/kumaraswamy/lib/object_mode.js", "../streams/kumaraswamy/lib/factory.js", "../streams/kumaraswamy/lib/index.js", "../streams/laplace/lib/defaults.json", "../streams/laplace/lib/validate.js", "../streams/laplace/lib/debug.js", "../streams/laplace/lib/main.js", "../streams/laplace/lib/object_mode.js", "../streams/laplace/lib/factory.js", "../streams/laplace/lib/index.js", "../streams/levy/lib/defaults.json", "../streams/levy/lib/validate.js", "../streams/levy/lib/debug.js", "../streams/levy/lib/main.js", "../streams/levy/lib/object_mode.js", "../streams/levy/lib/factory.js", "../streams/levy/lib/index.js", "../streams/logistic/lib/defaults.json", "../streams/logistic/lib/validate.js", "../streams/logistic/lib/debug.js", "../streams/logistic/lib/main.js", "../streams/logistic/lib/object_mode.js", "../streams/logistic/lib/factory.js", "../streams/logistic/lib/index.js", "../streams/lognormal/lib/defaults.json", "../streams/lognormal/lib/validate.js", "../streams/lognormal/lib/debug.js", "../streams/lognormal/lib/main.js", "../streams/lognormal/lib/object_mode.js", "../streams/lognormal/lib/factory.js", "../streams/lognormal/lib/index.js", "../streams/minstd/lib/defaults.json", "../streams/minstd/lib/validate.js", "../streams/minstd/lib/debug.js", "../streams/minstd/lib/main.js", "../streams/minstd/lib/object_mode.js", "../streams/minstd/lib/factory.js", "../streams/minstd/lib/index.js", "../streams/minstd-shuffle/lib/defaults.json", "../streams/minstd-shuffle/lib/validate.js", "../streams/minstd-shuffle/lib/debug.js", "../streams/minstd-shuffle/lib/main.js", "../streams/minstd-shuffle/lib/object_mode.js", "../streams/minstd-shuffle/lib/factory.js", "../streams/minstd-shuffle/lib/index.js", "../streams/mt19937/lib/defaults.json", "../streams/mt19937/lib/validate.js", "../streams/mt19937/lib/debug.js", "../streams/mt19937/lib/main.js", "../streams/mt19937/lib/object_mode.js", "../streams/mt19937/lib/factory.js", "../streams/mt19937/lib/index.js", "../streams/negative-binomial/lib/defaults.json", "../streams/negative-binomial/lib/validate.js", "../streams/negative-binomial/lib/debug.js", "../streams/negative-binomial/lib/main.js", "../streams/negative-binomial/lib/object_mode.js", "../streams/negative-binomial/lib/factory.js", "../streams/negative-binomial/lib/index.js", "../streams/normal/lib/defaults.json", "../streams/normal/lib/validate.js", "../streams/normal/lib/debug.js", "../streams/normal/lib/main.js", "../streams/normal/lib/object_mode.js", "../streams/normal/lib/factory.js", "../streams/normal/lib/index.js", "../streams/pareto-type1/lib/defaults.json", "../streams/pareto-type1/lib/validate.js", "../streams/pareto-type1/lib/debug.js", "../streams/pareto-type1/lib/main.js", "../streams/pareto-type1/lib/object_mode.js", "../streams/pareto-type1/lib/factory.js", "../streams/pareto-type1/lib/index.js", "../streams/poisson/lib/defaults.json", "../streams/poisson/lib/validate.js", "../streams/poisson/lib/debug.js", "../streams/poisson/lib/main.js", "../streams/poisson/lib/object_mode.js", "../streams/poisson/lib/factory.js", "../streams/poisson/lib/index.js", "../streams/randi/lib/defaults.json", "../streams/randi/lib/validate.js", "../streams/randi/lib/debug.js", "../streams/randi/lib/main.js", "../streams/randi/lib/object_mode.js", "../streams/randi/lib/factory.js", "../streams/randi/lib/index.js", "../streams/randn/lib/defaults.json", "../streams/randn/lib/validate.js", "../streams/randn/lib/debug.js", "../streams/randn/lib/main.js", "../streams/randn/lib/object_mode.js", "../streams/randn/lib/factory.js", "../streams/randn/lib/index.js", "../streams/randu/lib/defaults.json", "../streams/randu/lib/validate.js", "../streams/randu/lib/debug.js", "../streams/randu/lib/main.js", "../streams/randu/lib/object_mode.js", "../streams/randu/lib/factory.js", "../streams/randu/lib/index.js", "../streams/rayleigh/lib/defaults.json", "../streams/rayleigh/lib/validate.js", "../streams/rayleigh/lib/debug.js", "../streams/rayleigh/lib/main.js", "../streams/rayleigh/lib/object_mode.js", "../streams/rayleigh/lib/factory.js", "../streams/rayleigh/lib/index.js", "../streams/t/lib/defaults.json", "../streams/t/lib/validate.js", "../streams/t/lib/debug.js", "../streams/t/lib/main.js", "../streams/t/lib/object_mode.js", "../streams/t/lib/factory.js", "../streams/t/lib/index.js", "../streams/triangular/lib/defaults.json", "../streams/triangular/lib/validate.js", "../streams/triangular/lib/debug.js", "../streams/triangular/lib/main.js", "../streams/triangular/lib/object_mode.js", "../streams/triangular/lib/factory.js", "../streams/triangular/lib/index.js", "../streams/uniform/lib/defaults.json", "../streams/uniform/lib/validate.js", "../streams/uniform/lib/debug.js", "../streams/uniform/lib/main.js", "../streams/uniform/lib/object_mode.js", "../streams/uniform/lib/factory.js", "../streams/uniform/lib/index.js", "../streams/weibull/lib/defaults.json", "../streams/weibull/lib/validate.js", "../streams/weibull/lib/debug.js", "../streams/weibull/lib/main.js", "../streams/weibull/lib/object_mode.js", "../streams/weibull/lib/factory.js", "../streams/weibull/lib/index.js", "../streams/lib/index.js", "../strided/arcsine/lib/prng.js", "../strided/arcsine/lib/main.js", "../strided/arcsine/lib/ndarray.js", "../strided/arcsine/lib/index.js", "../strided/beta/lib/prng.js", "../strided/beta/lib/main.js", "../strided/beta/lib/ndarray.js", "../strided/beta/lib/index.js", "../strided/betaprime/lib/prng.js", "../strided/betaprime/lib/main.js", "../strided/betaprime/lib/ndarray.js", "../strided/betaprime/lib/index.js", "../strided/cosine/lib/prng.js", "../strided/cosine/lib/main.js", "../strided/cosine/lib/ndarray.js", "../strided/cosine/lib/index.js", "../strided/discrete-uniform/lib/prng.js", "../strided/discrete-uniform/lib/main.js", "../strided/discrete-uniform/lib/ndarray.js", "../strided/discrete-uniform/lib/index.js", "../strided/exponential/lib/prng.js", "../strided/exponential/lib/main.js", "../strided/exponential/lib/ndarray.js", "../strided/exponential/lib/index.js", "../strided/gamma/lib/prng.js", "../strided/gamma/lib/main.js", "../strided/gamma/lib/ndarray.js", "../strided/gamma/lib/index.js", "../strided/invgamma/lib/prng.js", "../strided/invgamma/lib/main.js", "../strided/invgamma/lib/ndarray.js", "../strided/invgamma/lib/index.js", "../strided/lognormal/lib/prng.js", "../strided/lognormal/lib/main.js", "../strided/lognormal/lib/ndarray.js", "../strided/lognormal/lib/index.js", "../strided/minstd/lib/main.js", "../strided/minstd/lib/ndarray.js", "../strided/minstd/lib/normalized.js", "../strided/minstd/lib/normalized.ndarray.js", "../strided/minstd/lib/index.js", "../strided/minstd-shuffle/lib/main.js", "../strided/minstd-shuffle/lib/ndarray.js", "../strided/minstd-shuffle/lib/normalized.js", "../strided/minstd-shuffle/lib/normalized.ndarray.js", "../strided/minstd-shuffle/lib/index.js", "../strided/mt19937/lib/main.js", "../strided/mt19937/lib/ndarray.js", "../strided/mt19937/lib/normalized.js", "../strided/mt19937/lib/normalized.ndarray.js", "../strided/mt19937/lib/index.js", "../strided/normal/lib/prng.js", "../strided/normal/lib/main.js", "../strided/normal/lib/ndarray.js", "../strided/normal/lib/index.js", "../strided/randu/lib/main.js", "../strided/randu/lib/ndarray.js", "../strided/randu/lib/index.js", "../strided/uniform/lib/prng.js", "../strided/uniform/lib/main.js", "../strided/uniform/lib/ndarray.js", "../strided/uniform/lib/index.js", "../strided/weibull/lib/prng.js", "../strided/weibull/lib/main.js", "../strided/weibull/lib/ndarray.js", "../strided/weibull/lib/index.js", "../strided/lib/index.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = UINT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\( [1, 2^{32}-1) \\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randuint32();\n* // returns \n*/\nfunction randuint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v >>> 0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = randuint32;\n", "/* eslint-disable max-lines, max-len */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The original C code and copyright notice are from the [source implementation][mt19937]. The implementation has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n* All rights reserved.\n*\n* Redistribution and use in source and binary forms, with or without\n* modification, are permitted provided that the following conditions\n* are met:\n*\n* 1. Redistributions of source code must retain the above copyright\n* notice, this list of conditions and the following disclaimer.\n*\n* 2. Redistributions in binary form must reproduce the above copyright\n* notice, this list of conditions and the following disclaimer in the\n* documentation and/or other materials provided with the distribution.\n*\n* 3. The names of its contributors may not be used to endorse or promote\n* products derived from this software without specific prior written\n* permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n* \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n* ```\n*\n* [mt19937]: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar max = require( '@stdlib/math/base/special/max' );\nvar umul = require( '@stdlib/math/base/ops/umul' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar randuint32 = require( './rand_uint32.js' );\n\n\n// VARIABLES //\n\n// Define the size of the state array (see refs):\nvar N = 624;\n\n// Define a (magic) constant used for indexing into the state array:\nvar M = 397;\n\n// Define the maximum seed: 11111111111111111111111111111111\nvar MAX_SEED = UINT32_MAX >>> 0; // asm type annotation\n\n// For seed arrays, define an initial state (magic) constant: 19650218 => 00000001001010111101011010101010\nvar SEED_ARRAY_INIT_STATE = 19650218 >>> 0; // asm type annotation\n\n// Define a mask for the most significant `w-r` bits, where `w` is the word size (32 bits) and `r` is the separation point of one word (see refs): 2147483648 => 0x80000000 => 10000000000000000000000000000000\nvar UPPER_MASK = 0x80000000 >>> 0; // asm type annotation\n\n// Define a mask for the least significant `r` bits (see refs): 2147483647 => 0x7fffffff => 01111111111111111111111111111111\nvar LOWER_MASK = 0x7fffffff >>> 0; // asm type annotation\n\n// Define a multiplier (see Knuth TAOCP Vol2. 3rd Ed. P.106): 1812433253 => 01101100000001111000100101100101\nvar KNUTH_MULTIPLIER = 1812433253 >>> 0; // asm type annotation\n\n// Define a (magic) multiplier: 1664525 => 00000000000110010110011000001101\nvar MAGIC_MULTIPLIER_1 = 1664525 >>> 0; // asm type annotation\n\n// Define a (magic) multiplier: 1566083941 => 01011101010110001000101101100101\nvar MAGIC_MULTIPLIER_2 = 1566083941 >>> 0; // asm type annotation\n\n// Define a tempering coefficient: 2636928640 => 0x9d2c5680 => 10011101001011000101011010000000\nvar TEMPERING_COEFFICIENT_1 = 0x9d2c5680 >>> 0; // asm type annotation\n\n// Define a tempering coefficient: 4022730752 => 0xefc60000 => 11101111110001100000000000000000\nvar TEMPERING_COEFFICIENT_2 = 0xefc60000 >>> 0; // asm type annotation\n\n// Define a constant vector `a` (see refs): 2567483615 => 0x9908b0df => 10011001000010001011000011011111\nvar MATRIX_A = 0x9908b0df >>> 0; // asm type annotation\n\n// MAG01[x] = x * MATRIX_A; for x = {0,1}\nvar MAG01 = [ 0x0 >>> 0, MATRIX_A >>> 0 ]; // asm type annotation\n\n// Define a normalization constant when generating double-precision floating-point numbers: 2^53 => 9007199254740992\nvar FLOAT64_NORMALIZATION_CONSTANT = 1.0 / ( FLOAT64_MAX_SAFE_INTEGER+1.0 ); // eslint-disable-line id-length\n\n// 2^26: 67108864\nvar TWO_26 = 67108864 >>> 0; // asm type annotation\n\n// 2^32: 2147483648 => 0x80000000 => 10000000000000000000000000000000\nvar TWO_32 = 0x80000000 >>> 0; // asm type annotation\n\n// 1 (as a 32-bit unsigned integer): 1 => 0x1 => 00000000000000000000000000000001\nvar ONE = 0x1 >>> 0; // asm type annotation\n\n// Define the maximum normalized pseudorandom double-precision floating-point number: ( (((2^32-1)>>>5)*2^26)+( (2^32-1)>>>6) ) / 2^53\nvar MAX_NORMALIZED = FLOAT64_MAX_SAFE_INTEGER * FLOAT64_NORMALIZATION_CONSTANT;\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 3; // state, other, seed\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the index offset of the \"other\" section in the state array:\nvar OTHER_SECTION_OFFSET = N + 3; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = N + 5; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = N + 6; // 1 (version) + 1 (num_sections) + 1 (state_length) + N (state) + 1 (other_length) + 1 (state_index) + 1 (seed_length)\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible schema version. Expected: `%s`. Actual: `%s.`', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"state\" section must equal `N`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== N ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, N, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"other\" section must equal `1`...\n\tif ( state[ OTHER_SECTION_OFFSET ] !== 1 ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible section length. Expected: `%u`. Actual: `%u`.', s1, 1, state[ OTHER_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n/**\n* Returns an initial PRNG state.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {PositiveInteger} N - state size\n* @param {uinteger32} s - seed\n* @returns {Uint32Array} state array\n*/\nfunction createState( state, N, s ) {\n\tvar i;\n\n\t// Set the first element of the state array to the provided seed:\n\tstate[ 0 ] = s >>> 0; // equivalent to `s & 0xffffffffUL` in original C implementation\n\n\t// Initialize the remaining state array elements:\n\tfor ( i = 1; i < N; i++ ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_genrand()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (KNUTH_MULTIPLIER * (mt[i-1] ^ (mt[i-1] >> 30)) + i)\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( umul( s, KNUTH_MULTIPLIER ) + i )>>>0; // asm type annotation\n\t}\n\treturn state;\n}\n\n/**\n* Initializes a PRNG state array according to a seed array.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {NonNegativeInteger} N - state array length\n* @param {Collection} seed - seed array\n* @param {NonNegativeInteger} M - seed array length\n* @returns {Uint32Array} state array\n*/\nfunction initState( state, N, seed, M ) {\n\tvar s;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\ti = 1;\n\tj = 0;\n\tfor ( k = max( N, M ); k > 0; k-- ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_by_array()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1664525UL)) + seed[j] + j;\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\ts = ( umul( s, MAGIC_MULTIPLIER_1 ) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( ((state[i]>>>0)^s) + seed[j] + j )>>>0; /* non-linear */ // asm type annotation\n\n\t\ti += 1;\n\t\tj += 1;\n\t\tif ( i >= N ) {\n\t\t\tstate[ 0 ] = state[ N-1 ];\n\t\t\ti = 1;\n\t\t}\n\t\tif ( j >= M ) {\n\t\t\tj = 0;\n\t\t}\n\t}\n\tfor ( k = N-1; k > 0; k-- ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_by_array()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1566083941UL)) - i;\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\ts = ( umul( s, MAGIC_MULTIPLIER_2 ) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( ((state[i]>>>0)^s) - i )>>>0; /* non-linear */ // asm type annotation\n\n\t\ti += 1;\n\t\tif ( i >= N ) {\n\t\t\tstate[ 0 ] = state[ N-1 ];\n\t\t\ti = 1;\n\t\t}\n\t}\n\t// Ensure a non-zero initial state array:\n\tstate[ 0 ] = TWO_32; // MSB (most significant bit) is 1\n\n\treturn state;\n}\n\n/**\n* Updates a PRNG's internal state by generating the next `N` words.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @returns {Uint32Array} state array\n*/\nfunction twist( state ) {\n\tvar w;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tk = N - M;\n\tfor ( i = 0; i < k; i++ ) {\n\t\tw = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );\n\t\tstate[ i ] = state[ i+M ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\t}\n\tj = N - 1;\n\tfor ( ; i < j; i++ ) {\n\t\tw = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );\n\t\tstate[ i ] = state[ i-k ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\t}\n\tw = ( state[j]&UPPER_MASK ) | ( state[0]&LOWER_MASK );\n\tstate[ j ] = state[ M-1 ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\treturn state;\n}\n\n\n// MAIN //\n\n/**\n* Returns a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* ## Notes\n*\n* - In contrast to the original C implementation, array seeds of length `1` are considered integer seeds. This ensures that the seed `[ 1234 ]` generates the same output as the seed `1234`. In the original C implementation, the two seeds would yield different output, which is **not** obvious from a user perspective.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} a seed must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integers less than or equal to the maximum unsigned 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than or equal to the maximum unsigned 32-bit integer\n* @throws {TypeError} state must be a `Uint32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} Mersenne Twister PRNG\n*\n* @example\n* var mt19937 = factory();\n*\n* var v = mt19937();\n* // returns \n*\n* @example\n* // Return a seeded Mersenne Twister PRNG:\n* var mt19937 = factory({\n* 'seed': 1234\n* });\n*\n* var v = mt19937();\n* // returns 822569775\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isUint32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Uint32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state \"view\":\n\t\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed >>>= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) === false || seed.length < 1 ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t} else if ( seed.length === 1 ) {\n\t\t\t\t\tseed = seed[ 0 ];\n\t\t\t\t\tif ( !isPositiveInteger( seed ) ) {\n\t\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed >>>= 0; // asm type annotation\n\t\t\t\t} else {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Uint32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = N;\n\t\t\t\t\tSTATE[ OTHER_SECTION_OFFSET ] = 1;\n\t\t\t\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state \"view\":\n\t\t\t\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate = createState( state, N, SEED_ARRAY_INIT_STATE );\n\t\t\t\t\tstate = initState( state, N, seed, slen );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randuint32() >>> 0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randuint32() >>> 0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Uint32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = N;\n\t\tSTATE[ OTHER_SECTION_OFFSET ] = 1;\n\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state \"view\":\n\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate = createState( state, N, seed );\n\t}\n\t// Note: property order matters in order to maintain consistency of PRNG \"shape\" (hidden classes).\n\tsetReadOnly( mt19937, 'NAME', 'mt19937' );\n\tsetReadOnlyAccessor( mt19937, 'seed', getSeed );\n\tsetReadOnlyAccessor( mt19937, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( mt19937, 'state', getState, setState );\n\tsetReadOnlyAccessor( mt19937, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( mt19937, 'byteLength', getStateSize );\n\tsetReadOnly( mt19937, 'toJSON', toJSON );\n\tsetReadOnly( mt19937, 'MIN', 0 );\n\tsetReadOnly( mt19937, 'MAX', UINT32_MAX );\n\tsetReadOnly( mt19937, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', mt19937.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', 0.0 );\n\tsetReadOnly( normalized, 'MAX', MAX_NORMALIZED );\n\n\treturn mt19937;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Uint32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `3` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. internal PRNG state\n\t* 2. auxiliary state information\n\t* 3. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Uint32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - If PRNG state is \"shared\" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Uint32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state \"view\":\n\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = mt19937.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [0, 2^{32}) \\\\).\n\t*\n\t* @private\n\t* @returns {uinteger32} pseudorandom integer\n\t*\n\t* @example\n\t* var r = mt19937();\n\t* // returns \n\t*/\n\tfunction mt19937() {\n\t\tvar r;\n\t\tvar i;\n\n\t\t// Retrieve the current state index:\n\t\ti = STATE[ OTHER_SECTION_OFFSET+1 ];\n\n\t\t// Determine whether we need to update the PRNG state:\n\t\tif ( i >= N ) {\n\t\t\tstate = twist( state );\n\t\t\ti = 0;\n\t\t}\n\t\t// Get the next word of \"raw\"/untempered state:\n\t\tr = state[ i ];\n\n\t\t// Update the state index:\n\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = i + 1;\n\n\t\t// Tempering transform to compensate for the reduced dimensionality of equidistribution:\n\t\tr ^= r >>> 11;\n\t\tr ^= ( r << 7 ) & TEMPERING_COEFFICIENT_1;\n\t\tr ^= ( r << 15 ) & TEMPERING_COEFFICIENT_2;\n\t\tr ^= r >>> 18;\n\n\t\treturn r >>> 0;\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0, 1) \\\\).\n\t*\n\t* ## Notes\n\t*\n\t* - The original C implementation credits Isaku Wada for this algorithm (2002/01/09).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = normalized();\n\t* // returns \n\t*/\n\tfunction normalized() {\n\t\tvar x = mt19937() >>> 5;\n\t\tvar y = mt19937() >>> 6;\n\t\treturn ( (x*TWO_26)+y ) * FLOAT64_NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\nvar randuint32 = require( './rand_uint32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [0, 2^{32}) \\\\).\n*\n* ## Method\n*\n* - When generating normalized double-precision floating-point numbers, we first generate two pseudorandom integers \\\\( x \\\\) and \\\\( y \\\\) on the interval \\\\( [0, 2^{32}) \\\\) for a combined \\\\( 64 \\\\) random bits.\n*\n* - We would like \\\\( 53 \\\\) random bits to generate a 53-bit precision integer and, thus, want to discard \\\\( 11 \\\\) of the generated bits.\n*\n* - We do so by discarding \\\\( 5 \\\\) bits from \\\\( x \\\\) and \\\\( 6 \\\\) bits from \\\\( y \\\\).\n*\n* - Accordingly, \\\\( x \\\\) contains \\\\( 27 \\\\) random bits, which are subsequently shifted left \\\\( 26 \\\\) bits (multiplied by \\\\( 2^{26} \\\\), and \\\\( y \\\\) contains \\\\( 26 \\\\) random bits to fill in the lower \\\\( 26 \\\\) bits. When summed, they combine to comprise \\\\( 53 \\\\) random bits of a double-precision floating-point integer.\n*\n* - As an example, suppose, for the sake of argument, the 32-bit PRNG generates the maximum unsigned 32-bit integer \\\\( 2^{32}-1 \\\\) twice in a row. Then,\n*\n* ```javascript\n* x = 4294967295 >>> 5; // 00000111111111111111111111111111\n* y = 4294967295 >>> 6; // 00000011111111111111111111111111\n* ```\n*\n* Multiplying \\\\( x \\\\) by \\\\( 2^{26} \\\\) returns \\\\( 9007199187632128 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 10000110011 11111111111111111111 11111100000000000000000000000000\n* ```\n*\n* Adding \\\\( y \\\\) yields \\\\( 9007199254740991 \\\\) (the maximum \"safe\" double-precision floating-point integer value), which, in binary, is\n*\n* ```binarystring\n* 0 10000110011 11111111111111111111 11111111111111111111111111111111\n* ```\n*\n* - Similarly, suppose the 32-bit PRNG generates the following values\n*\n* ```javascript\n* x = 1 >>> 5; // 0 => 00000000000000000000000000000000\n* y = 64 >>> 6; // 1 => 00000000000000000000000000000001\n* ```\n*\n* Multiplying \\\\( x \\\\) by \\\\( 2^{26} \\\\) returns \\\\( 0 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 00000000000 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* Adding \\\\( y \\\\) yields \\\\( 1 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 01111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* - As different combinations of \\\\( x \\\\) and \\\\( y \\\\) are generated, different combinations of double-precision floating-point exponent and significand bits will be toggled, thus generating pseudorandom double-precision floating-point numbers.\n*\n* ## References\n*\n* - Matsumoto, Makoto, and Takuji Nishimura. 1998. \"Mersenne Twister: A 623-dimensionally Equidistributed Uniform Pseudo-random Number Generator.\" _ACM Transactions on Modeling and Computer Simulation_ 8 (1). New York, NY, USA: ACM: 3\u201330. doi:[10.1145/272991.272995][@matsumoto:1998a].\n* - Harase, Shin. 2017. \"Conversion of Mersenne Twister to double-precision floating-point numbers.\" _ArXiv_ abs/1708.06018 (September). .\n*\n* [@matsumoto:1998a]: https://doi.org/10.1145/272991.272995\n*\n* @function mt19937\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = mt19937();\n* // returns \n*/\nvar mt19937 = factory({\n\t'seed': randuint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/base/mt19937\n*\n* @example\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n*\n* var v = mt19937();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/mt19937' ).factory;\n*\n* var mt19937 = factory({\n* 'seed': 1234\n* });\n*\n* var v = mt19937();\n* // returns 822569775\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar sin = require( '@stdlib/math/base/special/sin' );\nvar HALF_PI = require( '@stdlib/constants/float64/half-pi' );\n\n\n// MAIN //\n\n/**\n* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {number} pseudorandom number\n*/\nfunction arcsine( rand, a, b ) {\n\treturn a + ( pow( sin( HALF_PI*rand() ), 2.0 ) * ( b-a ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar arcsine0 = require( './arcsine.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating arcsine distributed random numbers.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var arcsine = factory( 0.0, 1.0 );\n*\n* var v = arcsine();\n* // returns \n*\n* @example\n* var arcsine = factory( -3.0, -1.0, {\n* 'seed': 297\n* });\n* var v = arcsine();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = arcsine2;\n\t} else {\n\t\tprng = arcsine1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'arcsine' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = arcsine1();\n\t* // returns \n\t*/\n\tfunction arcsine1() {\n\t\treturn arcsine0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = arcsine2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = arcsine2( 1.0, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction arcsine2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta >= b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn arcsine0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @name arcsine\n* @type {PRNG}\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = arcsine( 0.0, 1.0 );\n* // returns \n*/\nvar arcsine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Arcsine distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/arcsine\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var v = arcsine( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/arcsine' ).factory;\n*\n* var arcsine = factory( -5.0, 5.0, {\n* 'seed': 297\n* });\n*\n* var v = arcsine();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/arcsine' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var arcsine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = arcsine( 10 );\n* // returns \n*\n* @example\n* var arcsine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = arcsine( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = arcsine2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = arcsine2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = arcsine1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = arcsine1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from an arcsine distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction arcsine1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from an arcsine distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction arcsine2( len, a, b, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ a ], [ b ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( a, b );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an arcsine distribution with minimum support `a` and maximum support `b`.\n*\n* @name arcsine\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = arcsine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = arcsine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar arcsine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from an arcsine distribution with minimum support `a` and maximum support `b`.\n*\n* @module @stdlib/random/array/arcsine\n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var arr = arcsine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var arr = arcsine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var rand = arcsine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var rand = arcsine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// VARIABLES //\n\n// (R*phi(R) + Pr(X>=R))*sqrt(2\\pi)\nvar V = 9.91256303526217e-3;\n\n\n// MAIN //\n\n/**\n* Returns an array containing coordinates such that each rectangle has the same area.\n*\n* @private\n* @param {PositiveInteger} N - number of rectangles\n* @param {number} rTail - start of right tail\n* @returns {NumberArray} coordinate array\n*\n* @example\n* var X = coordsArray( 128, 3.44 );\n* // returns \n*/\nfunction coordsArray( N, rTail ) {\n\tvar X;\n\tvar f;\n\tvar i;\n\n\tf = exp( -0.5 * rTail * rTail );\n\n\tX = [];\n\tX.push( V/f ); // bottom block: V / f(R)\n\tX.push( rTail );\n\tfor ( i = 2; i < N; i++ ) {\n\t\tX[ i ] = sqrt( -2.0 * ln( ( V/X[i-1] ) + f ) );\n\t\tf = exp( -0.5 * X[ i ] * X[ i ] );\n\t}\n\tX.push( 0.0 );\n\treturn X;\n}\n\n\n// EXPORTS //\n\nmodule.exports = coordsArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array containing the ratio of each pair of consecutive elements in order: `X[ i+1 ] / X[ i ]`.\n*\n* @private\n* @param {NumberArray} X - input array\n* @returns {NumberArray} ratio array\n*\n* @example\n* var R = ratioArray( [ 1.0, 2.0, 5.0 ] );\n* // returns [ 2.0, 2.5 ]\n*/\nfunction ratioArray( X ) {\n\tvar R;\n\tvar i;\n\n\tR = [];\n\tfor ( i = 0; i < X.length-1; i++ ) {\n\t\tR.push( X[ i+1 ] / X[ i ] );\n\t}\n\treturn R;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ratioArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Transforms the tail of the normal distribution to the unit interval and then uses rejection technique to generate standard normal variable.\n*\n* ## References\n*\n* - Marsaglia, George. 1964. \"Generating a Variable from the Tail of the Normal Distribution.\" _Technometrics_ 6 (1): 101\u20132. doi:[10.1080/00401706.1964.10490150](http://dx.doi.org/10.1080/00401706.1964.10490150).\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} rTail - start value of the right tail\n* @param {boolean} isNegative - boolean indicating which side to evaluate\n* @returns {number} standard normal variable\n*/\nfunction sampleTail( rand, rTail, isNegative ) {\n\tvar x;\n\tvar y;\n\tdo {\n\t\tx = ln( rand() ) / rTail;\n\t\ty = ln( rand() );\n\t} while ( -2.0*y < x*x );\n\treturn ( isNegative ) ? x-rTail : rTail-x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sampleTail;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar coordsArray = require( './coords_array.js' );\nvar ratioArray = require( './ratio_array.js' );\nvar sampleTail = require( './sample_tail.js' );\n\n\n// VARIABLES //\n\n// Number of blocks:\nvar NUM_BLOCKS = 128;\n\n// Start of right tail (R):\nvar START_RIGHT_TAIL = 3.442619855899;\n\n// `X` holds coordinates, such that each rectangle has same area:\nvar X = coordsArray( NUM_BLOCKS, START_RIGHT_TAIL );\n\n// `R` holds `X[ i+1 ] / X[ i ]`:\nvar R = ratioArray( X );\n\n// 127 => 0x7F => 00000000000000000000000001111111\nvar LAST_7_BITS_MASK = 127|0; // asm type annotation\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the improved Ziggurat algorithm for generating normally distributed pseudorandom numbers.\n*\n* @private\n* @param {PRNG} randu - PRNG for generating uniformly distributed numbers\n* @param {PRNG} randi - PRNG for generating uniformly distributed integers\n* @returns {number} pseudorandom number\n*/\nfunction wrap( randu, randi ) {\n\treturn randn;\n\n\t/**\n\t* Generates a normally distributed pseudorandom number.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = randn();\n\t* // returns \n\t*/\n\tfunction randn() {\n\t\tvar f0;\n\t\tvar f1;\n\t\tvar x2;\n\t\tvar x;\n\t\tvar u;\n\t\tvar i;\n\t\tvar j;\n\t\twhile ( true ) {\n\t\t\tu = ( 2.0*randu() ) - 1.0;\n\t\t\ti = randi() & LAST_7_BITS_MASK;\n\n\t\t\t// First try the rectangular boxes...\n\t\t\tif ( abs( u ) < R[ i ] ) {\n\t\t\t\treturn u * X[ i ];\n\t\t\t}\n\t\t\t// If bottom box, sample from the tail...\n\t\t\tif ( i === 0 ) {\n\t\t\t\treturn sampleTail( randu, START_RIGHT_TAIL, u < 0.0 );\n\t\t\t}\n\t\t\t// Is this a sample from the wedges?\n\t\t\tx = u * X[ i ];\n\t\t\tx2 = x * x;\n\t\t\tj = i + 1;\n\t\t\tf0 = exp( -0.5 * ( (X[ i ]*X[ i ]) - x2 ) );\n\t\t\tf1 = exp( -0.5 * ( (X[ j ]*X[ j ]) - x2 ) );\n\t\t\tif ( f1 + (randu()*(f0-f1)) < 1.0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar improvedZiggurat = require( './improved_ziggurat.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the improved Ziggurat method to generate normally distributed pseudorandom numbers.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var r = randn();\n* // returns \n*\n* @example\n* // Return a seeded PRNG:\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar randu;\n\tvar randi;\n\tvar randn;\n\tvar opts;\n\n\topts = {\n\t\t'copy': true\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\t\tif ( !isFunction( options.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', options.prng ) );\n\t\t\t}\n\t\t\trandu = options.prng;\n\t\t}\n\t\t// If provided a PRNG, ignore the `state` option, as we don't support getting or setting PRNG state.\n\t\telse if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( !isUint32Array( options.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', options.state ) );\n\t\t\t}\n\t\t}\n\t\t// If provided a PRNG, ignore the `seed` option, as a `seed`, by itself, is insufficient to guarantee reproducibility. If provided a state, ignore the `seed` option, as a PRNG state should contain seed information.\n\t\telse if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( options.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', options.seed ) );\n\t\t\t}\n\t\t}\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( randu === void 0 ) {\n\t\t\trandi = mt19937( opts );\n\t\t\trandu = randi.normalized;\n\t\t} else {\n\t\t\trandi = mt19937({\n\t\t\t\t'seed': floor( 1.0 + ( UINT32_MAX*randu() ) ), // allows seeding via an externally seeded PRNG\n\t\t\t\t'copy': opts.copy\n\t\t\t});\n\t\t\topts.seed = null;\n\t\t}\n\t} else {\n\t\trandi = mt19937( opts );\n\t\trandu = randi.normalized;\n\t}\n\trandn = improvedZiggurat( randu, randi );\n\n\tsetReadOnly( randn, 'NAME', 'improved-ziggurat' );\n\tif ( opts.seed === null ) {\n\t\tsetReadOnly( randn, 'seed', null );\n\t\tsetReadOnly( randn, 'seedLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( randn, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( randn, 'seedLength', getSeedLength );\n\t}\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( options && options.prng ) {\n\t\tsetReadWriteAccessor( randn, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( randn, 'stateLength', null );\n\t\tsetReadOnly( randn, 'byteLength', null );\n\t\tsetReadOnly( randn, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadWriteAccessor( randn, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( randn, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( randn, 'byteLength', getStateSize );\n\t\tsetReadOnly( randn, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( randn, 'PRNG', randu );\n\n\treturn randn;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn randi.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn randi.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn randi.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn randi.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn randi.state;\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trandi.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = randn.NAME;\n\t\tout.state = typedarray2json( randi.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a standard normally distributed random number.\n*\n* ## Method\n*\n* The basic Ziggurat method works as follows:\n*\n* ```tex\n* x_{C-1}(r) \\left[ f(0) - f\\left( x_{C-1}(r) \\right) \\right] - V(r) = 0\n* ```\n*\n* where\n*\n* ```tex\n* V(r) = r \\; f(r) + \\int_r^\\infty \\; f(x) \\; dx\n* ```\n*\n* and \\\\( r \\\\) denotes the right-most \\\\( x_1 \\\\).\n*\n* - We then use the following rejection algorithm:\n*\n* - Draw a box \\\\( B_i \\\\) at random with probability \\\\( \\tfrac{1}{C} \\\\).\n* - Draw a random number from the box as \\\\( z = U_0 x_i \\\\) for \\\\( i > 0 \\\\) and \\\\( z = U_0 V / f(x_1) \\\\).\n* - If \\\\( z < x_{i+1} \\\\), accept \\\\( z \\\\).\n* - If \\\\( i = 0 \\\\), accept a \\\\( v \\\\) by transforming the tail of the normal distribution to the unit interval and then use rejection technique by Marsaglia, G. (1964) to generate a standard normal variable. Otherwise, if \\\\( i > 0 \\\\) and \\\\( U_1 \\left[ f(x_i) - f(x_{i+1})\\right] < f(z) - f(x_{i+1}) \\\\) accept \\\\( z \\\\).\n* - Go back to the first step.\n*\n* - The improved version by Doornik (2005) changes step four in order to correct a deficiency of the original Ziggurat algorithm. The updated version requires the generation of two random numbers, a uniform variable drawn from \\\\( U(-1,1) \\\\) and the last seven bits of a random integer.\n*\n* ## References\n*\n* - Doornik, Jurgen A. 2005. \"An Improved Ziggurat Method to Generate Normal Random Samples.\" .\n* - Marsaglia, George, and Wai Wan Tsang. 2000. \"The Ziggurat Method for Generating Random Variables.\" _Journal of Statistical Software_ 5 (1): 1\u20137. doi:[10.18637/jss.v005.i08](http://dx.doi.org/10.18637/jss.v005.i08).\n* - Marsaglia, George. 1964. \"Generating a Variable from the Tail of the Normal Distribution.\" _Technometrics_ 6 (1): 101\u20132. doi:[10.1080/00401706.1964.10490150](http://dx.doi.org/10.1080/00401706.1964.10490150).\n*\n* @name randn\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var r = randn();\n* // returns \n*/\nvar randn = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Normally distributed pseudorandom numbers using the improved Ziggurat method.\n*\n* @module @stdlib/random/base/improved-ziggurat\n*\n* @example\n* var randn = require( '@stdlib/random/base/improved-ziggurat' );\n*\n* var r = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/improved-ziggurat' ).factory;\n*\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// VARIABLES //\n\nvar ONE_THIRD = 1.0 / 3.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution with rate parameter equal to 1.0 and shape parameter equal to `alpha`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction standardGamma( randu, randn, alpha ) {\n\tvar flg;\n\tvar x2;\n\tvar v0;\n\tvar v1;\n\tvar c;\n\tvar d;\n\tvar x;\n\tvar s;\n\tvar u;\n\tvar v;\n\n\tif ( alpha < 1.0 ) {\n\t\td = alpha + 1.0 - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\ts = pow( randu(), 1.0/alpha );\n\t} else {\n\t\td = alpha - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\ts = 1.0;\n\t}\n\tflg = true;\n\twhile ( flg ) {\n\t\tdo {\n\t\t\tx = randn();\n\t\t\tv = 1.0 + (c*x);\n\t\t} while ( v <= 0.0 );\n\t\tv *= v * v;\n\t\tx2 = x * x;\n\t\tv0 = 1.0 - (0.331*x2*x2);\n\t\tv1 = (0.5*x2) + (d*( 1.0-v+ln(v) ));\n\t\tu = randu();\n\t\tif ( u < v0 || ln( u ) < v1 ) {\n\t\t\tflg = false;\n\t\t}\n\t}\n\treturn d * v * s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = standardGamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles case where `alpha` and `beta` are equal and greater than `1.5`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha ) {\n\tvar flg;\n\tvar s4;\n\tvar A;\n\tvar s;\n\tvar t;\n\tvar u;\n\tvar x;\n\tvar y;\n\n\tA = alpha - 1.0;\n\tt = pow( A+A, 0.5 );\n\n\tflg = true;\n\twhile ( flg === true ) {\n\t\ts = randn();\n\t\tx = 0.5 * ( 1.0+(s/t) );\n\t\tif ( x >= 0.0 && x <= 1.0 ) {\n\t\t\tu = randu();\n\t\t\ts4 = pow( s, 4.0 );\n\t\t\ty = (8.0*alpha) - 12.0;\n\t\t\ty = 1.0 - (s4 / y);\n\t\t\tif ( u <= y ) {\n\t\t\t\tflg = false;\n\t\t\t} else {\n\t\t\t\ty += 0.5 * pow( s4/((8.0*alpha)-8.0), 2.0 );\n\t\t\t\tif ( u < y ) {\n\t\t\t\t\ty = A * ln( 4.0*x*(1.0-x) );\n\t\t\t\t\ty += s*s / 2.0;\n\t\t\t\t\tif ( y >= ln( u ) ) {\n\t\t\t\t\t\tflg = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles case where both `alpha` and `beta` are greater than `1.0`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha, beta ) {\n\tvar sigma;\n\tvar flg;\n\tvar mu;\n\tvar A;\n\tvar B;\n\tvar C;\n\tvar L;\n\tvar s;\n\tvar u;\n\tvar x;\n\tvar y;\n\n\tA = alpha - 1.0;\n\tB = beta - 1.0;\n\tC = A + B;\n\tL = C * ln( C );\n\tmu = A / C;\n\tsigma = 0.5 / pow( C, 0.5 );\n\n\tflg = true;\n\twhile ( flg === true ) {\n\t\ts = randn();\n\t\tx = mu + (s*sigma);\n\t\tif ( x >= 0.0 && x <= 1.0 ) {\n\t\t\tu = randu();\n\t\t\ty = A * ln( x/A );\n\t\t\ty += B * ln((1.0-x) / B);\n\t\t\ty += L + (0.5*s*s);\n\t\t\tif ( y >= ln( u ) ) {\n\t\t\t\tflg = false;\n\t\t\t}\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles general case.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( rand, alpha, beta ) {\n\tvar lx;\n\tvar ly;\n\tvar xy;\n\tvar u;\n\tvar v;\n\tvar x;\n\tvar y;\n\twhile ( true ) {\n\t\tu = rand();\n\t\tv = rand();\n\t\tx = pow( u, 1.0/alpha );\n\t\ty = pow( v, 1.0/beta );\n\t\txy = x + y;\n\t\tif ( xy <= 1.0 ) {\n\t\t\tif ( xy > 0.0 ) {\n\t\t\t\treturn x / ( xy );\n\t\t\t}\n\t\t\tlx = ln( u ) / alpha;\n\t\t\tly = ln( v ) / beta;\n\t\t\tif ( lx > ly ) {\n\t\t\t\tly -= lx;\n\t\t\t\tlx = 0.0;\n\t\t\t} else {\n\t\t\t\tlx -= ly;\n\t\t\t\tly = 0.0;\n\t\t\t}\n\t\t\treturn exp( lx - ln( exp(lx) + exp(ly) ) );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar standardGamma = require( './standard_gamma.js' );\nvar sample1 = require( './sample1.js' );\nvar sample2 = require( './sample2.js' );\nvar sample3 = require( './sample3.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from a beta distribution.\n*\n* @private\n* @param {PRNG} randu - pseudorandom number generator for uniformly distributed numbers\n* @param {PRNG} randn - pseudorandom number generator for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha, beta ) {\n\tvar ga;\n\tvar gb;\n\tif ( alpha === beta && alpha > 1.5 ) {\n\t\treturn sample1( randu, randn, alpha );\n\t}\n\tif ( alpha > 1.0 && beta > 1.0 ) {\n\t\treturn sample2( randu, randn, alpha, beta );\n\t}\n\tif ( alpha < 1.0 && beta < 1.0 ) {\n\t\treturn sample3( randu, alpha, beta );\n\t}\n\t// General case of using two gamma random variates:\n\tga = standardGamma( randu, randn, alpha );\n\tgb = standardGamma( randu, randn, beta );\n\treturn ga / ( ga + gb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar beta0 = require( './beta.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating beta distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var beta = factory( 2.0, 1.0 );\n* var v = beta();\n* // returns \n*\n* @example\n* var beta = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = beta();\n* // returns \n*/\nfunction factory() {\n\tvar STATE;\n\tvar rnorm;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar FLG;\n\tvar err;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trand = randu( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trand = randu( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\trnorm = randn({\n\t\t\t'prng': opts.prng\n\t\t});\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rand.state;\n\t\t\trand.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\trnorm = randn({\n\t\t\t'state': STATE,\n\t\t\t'copy': false\n\t\t});\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = beta2;\n\t} else {\n\t\tprng = beta1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'beta' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta1();\n\t* // returns \n\t*/\n\tfunction beta1() {\n\t\treturn beta0( rand, rnorm, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction beta2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn beta0( rand, rnorm, alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a beta distributed random number.\n*\n* ## References\n*\n* - Ahrens, J.H., and U. Dieter. 1974. \"Computer methods for sampling from gamma, beta, poisson and bionomial distributions.\" _Computing_ 12 (3): 223\u201346. doi:[10.1007/BF02293108](http://dx.doi.org/10.1007/BF02293108).\n* - J\u00F6hnk, M.D. 1964. \"Erzeugung von Betaverteilten Und Gammaverteilten Zufallszahlen.\" _Metrika_ 8: 5\u201315. .\n*\n* @name beta\n* @type {PRNG}\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*\n* @example\n* var r = beta( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = beta( -2.0, 5.0 );\n* // returns NaN\n*/\nvar beta = factory();\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Beta distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/beta\n*\n* @example\n* var beta = require( '@stdlib/random/base/beta' );\n*\n* var v = beta( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/beta' ).factory;\n*\n* var beta = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = beta();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/beta' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var beta = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = beta( 10 );\n* // returns \n*\n* @example\n* var beta = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = beta( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = beta2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = beta2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = beta1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = beta1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a beta distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction beta1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a beta distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction beta2( len, alpha, beta, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ alpha ], [ beta ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( alpha, beta );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a beta distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n*\n* @name beta\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = beta( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = beta( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar beta = factory();\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a beta distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n*\n* @module @stdlib/random/array/beta\n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var arr = beta( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var arr = beta( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var rand = beta.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var rand = beta.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {PositiveNumber} beta - rate parameter\n* @param {PositiveNumber} d - `alpha + 2/3` or `alpha - 1/3`\n* @param {PositiveNumber} c - `1.0 / sqrt( 9.0*d )`\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction gamma( randu, randn, beta, d, c ) {\n\tvar flg;\n\tvar x2;\n\tvar v0;\n\tvar v1;\n\tvar x;\n\tvar u;\n\tvar v;\n\n\tflg = true;\n\twhile ( flg ) {\n\t\tdo {\n\t\t\tx = randn();\n\t\t\tv = 1.0 + (c*x);\n\t\t} while ( v <= 0.0 );\n\t\tv *= v * v;\n\t\tx2 = x * x;\n\t\tv0 = 1.0 - (0.331*x2*x2);\n\t\tv1 = (0.5*x2) + (d*( 1.0-v+ln(v) ));\n\t\tu = randu();\n\t\tif ( u < v0 || ln( u ) < v1 ) {\n\t\t\tflg = false;\n\t\t}\n\t}\n\treturn (1.0/beta) * d * v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar gamma0 = require( './gamma.js' );\n\n\n// VARIABLES //\n\nvar ONE_THIRD = 1.0 / 3.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating gamma distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var gamma = factory( 2.0, 1.0 );\n* var v = gamma();\n* // returns \n*\n* @example\n* var gamma = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = gamma();\n* // returns \n*/\nfunction factory() {\n\tvar STATE;\n\tvar alpha;\n\tvar rnorm;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar FLG;\n\tvar err;\n\tvar c;\n\tvar d;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trand = randu( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trand = randu( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\trnorm = randn({\n\t\t\t'prng': opts.prng\n\t\t});\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rand.state;\n\t\t\trand.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\trnorm = randn({\n\t\t\t'state': STATE,\n\t\t\t'copy': false\n\t\t});\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = gamma2;\n\t} else {\n\t\tif ( alpha >= 1.0 ) {\n\t\t\tprng = gamma1a;\n\t\t\td = alpha - ONE_THIRD;\n\t\t} else {\n\t\t\tprng = gamma1b;\n\t\t\td = alpha + 1.0 - ONE_THIRD;\n\t\t}\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t}\n\tsetReadOnly( prng, 'NAME', 'gamma' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution with bound parameters when `alpha >= 1`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma1a();\n\t* // returns \n\t*/\n\tfunction gamma1a() {\n\t\treturn gamma0( rand, rnorm, beta, d, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution with bound parameters when `alpha < 1`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma1b();\n\t* // returns \n\t*/\n\tfunction gamma1b() {\n\t\treturn gamma0( rand, rnorm, beta, d, c ) * pow( rand(), 1.0/alpha );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma2( 2.0, 4.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = gamma2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = gamma2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = gamma2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction gamma2( alpha, beta ) {\n\t\tvar c;\n\t\tvar d;\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\tif ( alpha < 1.0 ) {\n\t\t\td = alpha + 1.0 - ONE_THIRD;\n\t\t\tc = 1.0 / sqrt( 9.0*d );\n\t\t\treturn gamma0( rand, rnorm, beta, d, c ) * pow( rand(), 1.0/alpha );\n\t\t}\n\t\td = alpha - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\treturn gamma0( rand, rnorm, beta, d, c );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution.\n*\n* ## References\n*\n* - Marsaglia, George, and Wai Wan Tsang. 2000. \"A Simple Method for Generating Gamma Variables.\" _ACM Transactions on Mathematical Software_ 26 (3). New York, NY, USA: ACM: 363\u201372. doi:[10.1145/358407.358414](http://dx.doi.org/10.1145/358407.358414).\n*\n* @name gamma\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var v = gamma( 2.0, 4.0 );\n* // returns \n*\n* @example\n* var v = gamma( -2.0, 4.0 );\n* // returns NaN\n*/\nvar gamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Gamma distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/gamma\n*\n* @example\n* var gamma = require( '@stdlib/random/base/gamma' );\n*\n* var v = gamma( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gamma' ).factory;\n*\n* var gamma = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = gamma();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a random number drawn from a beta prime distribution.\n*\n* @private\n* @param {PRNG} rgamma - pseudorandom number generator for gamma distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction sample( rgamma, alpha, beta ) {\n\treturn rgamma( alpha, 1.0 ) / rgamma( beta, 1.0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar gammaFactory = require( './../../../base/gamma' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar betaprime0 = require( './betaprime.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating beta prime distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var betaprime = factory( 2.0, 1.0 );\n* var v = betaprime();\n* // returns \n*\n* @example\n* var betaprime = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = betaprime();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gammaFactory();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\trgamma = gammaFactory( opts );\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\trgamma = gammaFactory( opts );\n\t\t} else {\n\t\t\trgamma = gammaFactory();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = betaprime2;\n\t} else {\n\t\tprng = betaprime1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'betaprime' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta prime distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = betaprime1();\n\t* // returns \n\t*/\n\tfunction betaprime1() {\n\t\treturn betaprime0( rgamma, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = betaprime2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction betaprime2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn betaprime0( rgamma, alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a beta prime distributed random number.\n*\n* @name betaprime\n* @type {PRNG}\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var r = betaprime( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = betaprime( -2.0, 5.0 );\n* // returns NaN\n*/\nvar betaprime = factory();\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Beta prime distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/betaprime\n*\n* @example\n* var betaprime = require( '@stdlib/random/base/betaprime' );\n*\n* var v = betaprime( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/betaprime' ).factory;\n*\n* var betaprime = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = betaprime();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/betaprime' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var betaprime = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = betaprime( 10 );\n* // returns \n*\n* @example\n* var betaprime = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = betaprime( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = betaprime2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = betaprime2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = betaprime1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = betaprime1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a beta prime distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction betaprime1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a beta prime distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction betaprime2( len, alpha, beta, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ alpha ], [ beta ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( alpha, beta );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a beta prime distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n*\n* @name beta\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = betaprime( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = betaprime( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar betaprime = factory();\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a beta prime distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n*\n* @module @stdlib/random/array/betaprime\n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var arr = betaprime( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var arr = betaprime( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var rand = betaprime.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var rand = betaprime.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, s ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar quantile = require( '@stdlib/stats/base/dists/cosine/quantile' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a raised cosine distribution using inverse transform sampling.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction sample( rand, mu, s ) {\n\treturn quantile( rand(), mu, s );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar cosine0 = require( './cosine.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a raised cosine distribution.\n*\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var cosine = factory( 0.0, 1.0 );\n* var v = cosine();\n* // returns \n*\n* @example\n* var cosine = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = cosine();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar s;\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\terr = validate( mu, s );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = cosine2;\n\t} else {\n\t\tprng = cosine1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'cosine' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, s ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a raised cosine distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cosine1();\n\t* // returns \n\t*/\n\tfunction cosine1() {\n\t\treturn cosine0( rand, mu, s );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cosine2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = cosine2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction cosine2( mu, s ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( s ) ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn cosine0( rand, mu, s );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a raised cosine distribution.\n*\n* @name cosine\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = cosine( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = cosine( 0.0, -1.0 );\n* // returns NaN\n*/\nvar cosine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Raised cosine distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/cosine\n*\n* @example\n* var cosine = require( '@stdlib/random/base/cosine' );\n*\n* var v = cosine( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cosine' ).factory;\n* var cosine = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = cosine();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cosine' ).factory;\n* var cosine = factory({\n* 'seed': 297\n* });\n*\n* var v = cosine( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/cosine' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var cosine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cosine( 10 );\n* // returns \n*\n* @example\n* var cosine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cosine( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = cosine2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = cosine2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = cosine1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = cosine1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a raised cosine distribution with parameters `mu` (mean) and `s` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction cosine1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a raised cosine distribution with parameters `mu` (mean) and `s` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction cosine2( len, mu, s, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ mu ], [ s ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( mu, s );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a raised cosine distribution with parameters `mu` (mean) and `s` (scale parameter).\n*\n* @name cosine\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = cosine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = cosine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar cosine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a raised cosine distribution with parameters `mu` (mean) and `s` (scale parameter).\n*\n* @module @stdlib/random/array/cosine\n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var arr = cosine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var arr = cosine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var rand = cosine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var rand = cosine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 20 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isInteger( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be an integer and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be an integer and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The original C++ code and copyright notice are from the [Boost library]{http://www.boost.org/doc/libs/1_65_1/doc/html/boost/random/uniform_int_distribution.html}. The implementation has been modified for JavaScript.\n*\n* ```text\n* (C) Copyright John Maddock 2006.\n* (C) Copyright Steven Watanabe 2011.\n*\n* Use, modification and distribution are subject to the\n* Boost Software License, Version 1.0. (See accompanying file\n* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator which outputs integer values\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {integer} pseudorandom number\n*/\nfunction discreteUniform( rand, a, b ) {\n\tvar result;\n\tvar RANGE;\n\tvar range;\n\tvar limit;\n\tvar bsize;\n\tvar mult;\n\tvar MIN;\n\tvar MAX;\n\tvar inc;\n\n\trange = b - a;\n\tif ( range === 0 ) {\n\t\treturn a;\n\t}\n\tMIN = rand.MIN;\n\tMAX = rand.MAX;\n\tRANGE = MAX - MIN;\n\tif ( RANGE === range ) {\n\t\treturn ( rand()-MIN ) + a;\n\t}\n\tif ( RANGE < range ) {\n\t\tlimit = 0;\n\t\twhile ( true ) {\n\t\t\t// Avoid overflow...\n\t\t\tif ( range === MAX_SAFE_INTEGER ) { // in JavaScript, we only explicitly have doubles\n\t\t\t\tlimit = floor( range / (RANGE+1) );\n\t\t\t\tif ( range%(RANGE+1) === RANGE ) { // e.g., 5%(2+1) == 2\n\t\t\t\t\tlimit += 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlimit = floor( (range+1) / (RANGE+1) );\n\t\t\t}\n\t\t\t// We consider `result` as expressed base `(RANGE+1)`:\n\t\t\tresult = 0;\n\n\t\t\t// For every power of `(RANGE+1)`, we determine a random factor:\n\t\t\tmult = 1;\n\n\t\t\t// Loop invariants: result < mult && mult <= range\n\t\t\twhile ( mult <= limit ) {\n\t\t\t\t// Note: see first and second post-conditions.\n\t\t\t\tresult += (rand() - MIN) * mult;\n\n\t\t\t\t// Equivalent to (mult * (RANGE+1)) == range+1, but avoids overflow...\n\t\t\t\tif ( mult*RANGE === range-mult+1 ) {\n\t\t\t\t\t// The destination range is an integer power of the generator's range...\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\t// Note: see third post-condition.\n\t\t\t\tmult *= RANGE + 1;\n\t\t\t}\n\t\t\t// range/mult < RANGE+1 (no endless loop)\n\t\t\tinc = discreteUniform( rand, 0, floor( range/mult ) );\n\t\t\tif ( inc > MAX_SAFE_INTEGER/mult ) {\n\t\t\t\t// The multiplication would overflow, so reject immediately...\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tinc *= mult;\n\t\t\tresult += inc;\n\n\t\t\t// NOTE: if we were working with unsigned integers, we would need to check that `result` is NOT less than `inc`, as unsigned integers wrap on overflow. In which case, we would need to reject.\n\n\t\t\tif ( result > range ) {\n\t\t\t\t// Result is too big, so reject...\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn result + a;\n\t\t}\n\t}\n\t// Case: RANGE > range\n\n\t// When determining the bucket size, avoid overflow...\n\tif ( RANGE === MAX_SAFE_INTEGER ) { // in JavaScript, we only explicitly have doubles\n\t\tbsize = floor( RANGE / (range+1) );\n\t\tif ( RANGE%(range+1) === range ) { // e.g., 5%(2+1) == 2\n\t\t\tbsize += 1;\n\t\t}\n\t} else {\n\t\tbsize = floor( (RANGE+1) / (range+1) );\n\t}\n\twhile ( true ) {\n\t\tresult = rand() - MIN;\n\t\tresult = floor( result / bsize );\n\t\tif ( result <= range ) {\n\t\t\treturn result + a;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randi = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar discreteUniform0 = require( './discrete_uniform.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers draw from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom integers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} provided PRNG must have a valid `MIN` property\n* @throws {TypeError} provided PRNG must have a valid `MAX` property\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var discreteUniform = factory( 1, 10 );\n* var v = discreteUniform();\n* // returns \n*\n* @example\n* var discreteUniform = factory( -30, -1, {\n* 'seed': 297\n* });\n* var v = discreteUniform();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randi();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t\tif ( !isInteger( rand.MIN ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t}\n\t\t\tif ( !isInteger( rand.MAX ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randi( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t\tif ( !isInteger( rand.MIN ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t\t}\n\t\t\t\tif ( !isInteger( rand.MAX ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trand = randi( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randi();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = discreteUniform2;\n\t} else {\n\t\tprng = discreteUniform1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'discrete-uniform' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = discreteUniform1();\n\t* // returns \n\t*/\n\tfunction discreteUniform1() {\n\t\treturn discreteUniform0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {integer} a - minimum support\n\t* @param {integer} b - maximum support\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = discreteUniform2( 1, 10 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = discreteUniform2( 1, 0 );\n\t* // returns NaN\n\t*/\n\tfunction discreteUniform2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\t!isInteger( a ) ||\n\t\t\t!isInteger( b ) ||\n\t\t\ta > b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn discreteUniform0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* ## Method\n*\n* - Let \\\\( R \\\\) be a pseudorandom generator (PRNG) which yields integers on the interval \\\\( \\[ A, B ] \\\\).\n*\n* - If \\\\( a = b \\\\), then \\\\( rv = a \\\\).\n*\n* - Let \\\\( r1 = b - a \\\\) and \\\\( r2 = B - A \\\\). If \\\\( r2 = r1 \\\\) (likely a rare occurrence), then\n*\n* ```tex\n* rv = ( R() - B ) + a\n* ```\n*\n* where, for real integer types, operation order is important in order to avoid overflow.\n*\n* - If \\\\( r2 < r1 \\\\), use rejection sampling to map random variates from \\\\( R \\\\) to a larger domain (e.g., \\\\( {0,1,2,3} \\rightarrow {0,1,2,3,4} \\\\)). For real integer types (and floating-point integer values), we must take extra care to avoid overflow. During sampling, the following conditions will hold:\n*\n* - First, consider the post-condition: \\\\( \\textrm{result} \\leq r2 \\\\), thus avoiding overflow.\n*\n* - Begin with definition of \\\\( \\textrm{limit} \\\\)\n*\n* ```tex\n* \\textrm{limit} = \\lfloor{\\frac{r2+1}{r1+1}\\rfloor\n* ```\n*\n* thus,\n*\n* ```tex\n* \\textrm{limit}\\ \\cdot (r1+1) \\leq r2+1\n* ```\n*\n* - Let \\\\( m \\\\) be a random factor where the loop condition is defined as\n*\n* ```tex\n* m \\leq \\textrm{limit}\n* ```\n*\n* - Let \\\\( \\textrm{result} \\\\) be the generator output, which is expressed base \\\\( r2+1 \\\\) and obeys the loop invariant \\\\( \\textrm{result} < m \\\\).\n*\n* - Let \\\\( rv \\\\) be a realization of the PRNG. Then,\n*\n* ```tex\n* rv-A \\leq r1\n* ```\n*\n* and, by the loop condition, \\\\( m \\leq \\textrm{limit} \\\\).\n*\n* - Therefore,\n*\n* ```tex\n* m \\cdot (rv - A + 1) \\leq r2+1\n* ```\n*\n* - Rearranging terms,\n*\n* ```tex\n* m + m \\cdot (rv - A) \\leq r2+1\n* ```\n*\n* - Since \\\\( \\textrm{result} < m \\\\),\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < r2+1\n* ```\n*\n* - Next, consider the post-condition: \\\\( \\textrm{result} < m \\cdot (r2+1) \\\\).\n*\n* - Since \\\\( \\textrm{result} < m \\\\) and \\\\( rv - A \\leq r1 \\\\),\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m + m \\cdot (rv - A)\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m + m \\cdot r1\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m \\cdot (r1+1)\n* ```\n*\n* - Next, consider the post-condition: \\\\( m \\leq r2 \\\\).\n*\n* - According to the definition of \\\\( \\textrm{limit} \\\\) and the loop condition \\\\( m \\leq \\textrm{limit} \\\\),\n*\n* ```tex\n* m \\cdot (r1+1) \\leq r2+1\n* ```\n*\n* - If \\\\( r2 \\\\) is **not** an integer power of the generator range \\\\( r1 \\\\), i.e.,\n*\n* ```tex\n* m \\cdot (r1+1) \\neq r2+1\n* ```\n*\n* then\n*\n* ```tex\n* m \\cdot (r1+1) < r2+1\n* ```\n*\n* - Thus, \\\\( \\textrm{result} < m \\\\).\n*\n* - Next, consider the post-condition: \\\\( r2/m < r1+1 \\\\).\n*\n* - To show this is true, let us try to prove its opposite. Given the loop condition \\\\( m > \\textrm{limit} \\\\), assume\n*\n* ```tex\n* r2/m > r1+1\n* ```\n*\n* - Accordingly,\n*\n* ```tex\n* r2 \\geq m \\cdot (r1+1)\n* ```\n*\n* - Hence,\n*\n* ```tex\n* r2+1 > m \\cdot (r1+1)\n* ```\n*\n* - Using the loop condition,\n*\n* ```tex\n* r2+1 > (\\textrm{limit}+1) \\cdot (r1+1)\n* ```\n*\n* - Rearranging terms,\n*\n* ```tex\n* \\frac{r2+1}{r1+1} > \\textrm{limit} + 1\n* ```\n*\n* - Hence,\n*\n* ```tex\n* \\textrm{limit} < \\lfloor{\\frac{r2+1}{r1+1}} \\rfloor\n* ```\n*\n* - But the definition of \\\\( \\textrm{limit} \\\\) is\n*\n* ```tex\n* \\textrm{limit} = \\lfloor{\\frac{r2+1}{r1+1}}\n* ```\n*\n* - Thus, our assumption cannot be true, providing the post-condition by reductio ad absurdum.\n*\n* - Next, consider the post-condition\n*\n* ```tex\n* r2 \\leq \\frac{r2}{m} \\cdot m + (m - 1)\n* ```\n*\n* - Recall the identity\n*\n* ```tex\n* r2 = \\frac{r2}{m} \\cdot m + r2 \\mod m\n* ```\n*\n* - By the definition of the modulus\n*\n* ```tex\n* r2 \\mod m < m\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* r2 < \\frac{r2}{m} \\cdot m + m\n* ```\n*\n* - Hence,\n*\n* ```tex\n* r2 \\leq \\frac{r2}{m} \\cdot m + (m - 1)\n* ```\n*\n* At this point, the maximum value \\\\( \\textrm{result} \\\\) is \\\\( m-1 \\\\). Hence, we can generate numbers that can be at least as large as \\\\( r2 \\\\), but we must be careful to avoid overflow during addition and in the sampling rejection. Anything which overflows is larger than \\\\( r2 \\\\) and can thus be rejected.\n*\n* - If \\\\( r1 > r2 \\\\), use rejection sampling to map random variates from \\\\( R \\\\) to a smaller domain (e.g., \\\\( {0,1,2,3,4} \\rightarrow {0,1,2,3} \\\\)) by defining \"buckets\" in which multiple random variates in \\\\( R \\\\) map to a single random variate in the smaller domain. We are safe in adding 1 to \\\\( r2 \\\\); however, we need to be careful to not cause overflow when adding 1 to \\\\( r1 \\\\).\n*\n* @name discreteUniform\n* @type {PRNG}\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {integer} pseudorandom number\n*\n* @example\n* var v = discreteUniform( 1, 10 );\n* // returns \n*/\nvar discreteUniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Discrete uniform distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/discrete-uniform\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );\n*\n* var v = discreteUniform( 1, 10 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/discrete-uniform' ).factory;\n* var discreteUniform = factory( -5, 5, {\n* 'seed': 297\n* });\n*\n* var v = discreteUniform();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/discrete-uniform' ).factory;\n* var discreteUniform = factory({\n* 'seed': 297\n* });\n*\n* var v = discreteUniform( -5, 5 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/discrete-uniform' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var uniform = factory( -10, 10 );\n* // returns \n*\n* var arr = uniform( 10 );\n* // returns \n*\n* @example\n* var uniform = factory( -10, 10 );\n* // returns \n*\n* var arr = uniform( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = uniform2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = uniform2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = uniform1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = uniform1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction uniform1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction uniform2( len, a, b, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ a ], [ b ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( a, b );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @name discreteUniform\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = discreteUniform( 10, -10, 10 );\n* // returns \n*\n* @example\n* var arr = discreteUniform( 10, -10, 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar discreteUniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @module @stdlib/random/array/discrete-uniform\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var arr = discreteUniform( 10, -10, 10 );\n* // returns \n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var arr = discreteUniform( 10, -10, 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var rand = discreteUniform.factory( -10, 10 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var rand = discreteUniform.factory( -10, 10 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an exponential distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction exponential( rand, lambda ) {\n\treturn -ln( 1.0 - rand() ) / lambda;\n}\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar exponential0 = require( './exponential.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating exponentially distributed random numbers.\n*\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var exponential = factory( 0.5 );\n* var v = exponential();\n* // returns \n*\n* @example\n* var exponential = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = exponential();\n* // returns ~3.735\n*\n* @example\n* var exponential = factory();\n* var v = exponential( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tlambda = arguments[ 0 ];\n\t\tif ( !isPositive( lambda ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = exponential2;\n\t} else {\n\t\tprng = exponential1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'exponential' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( lambda === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an exponential distribution with bound parameter `lambda`.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = exponential1();\n\t* // returns \n\t*/\n\tfunction exponential1() {\n\t\treturn exponential0( rand, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an exponential distribution with parameter `lambda`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = exponential2( 4.8 );\n\t* // returns \n\t*/\n\tfunction exponential2( lambda ) {\n\t\tif (\n\t\t\tisnan( lambda ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn exponential0( rand, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an exponential distribution with parameter `lambda`.\n*\n* @name exponential\n* @type {PRNG}\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = exponential( 4.8 );\n* // returns \n*\n* @example\n* var v = exponential( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = exponential( NaN );\n* // returns NaN\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Exponentially distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/exponential\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var v = exponential( 4.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/exponential' ).factory;\n*\n* var exponential = factory( 4.0, {\n* 'seed': 297\n* });\n*\n* var v = exponential();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/exponential' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar unary = require( '@stdlib/strided/base/unary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var exponential = factory( 2.0 );\n* // returns \n*\n* var arr = exponential( 10 );\n* // returns \n*\n* @example\n* var exponential = factory( 2.0 );\n* // returns \n*\n* var arr = exponential( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = exponential2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\tif ( isNumber( options ) ) {\n\t\t\trand = exponential1;\n\t\t} else {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\trand = exponential2;\n\t\t}\n\t} else if ( nargs === 2 ) {\n\t\toptions = arguments[ 1 ];\n\t\tprng = base.factory( arguments[ 0 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = exponential1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from an exponential distribution with rate parameter `lambda`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction exponential1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from an exponential distribution with rate parameter `lambda`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction exponential2( len, lambda, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 2 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tunary( [ [ lambda ], out ], [ len ], [ 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( lambda );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an exponential distribution with rate parameter `lambda`.\n*\n* @name exponential\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = exponential( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = exponential( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from an exponential distribution with rate parameter `lambda`.\n*\n* @module @stdlib/random/array/exponential\n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var arr = exponential( 10, 2.0 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var arr = exponential( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var rand = exponential.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var rand = exponential.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/gamma' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var gamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gamma( 10 );\n* // returns \n*\n* @example\n* var gamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gamma( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = gamma2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = gamma2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = gamma1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = gamma1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a gamma distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction gamma1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a gamma distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction gamma2( len, alpha, beta, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ alpha ], [ beta ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( alpha, beta );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a gamma distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter).\n*\n* @name gamma\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = gamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = gamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar gamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a gamma distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter).\n*\n* @module @stdlib/random/array/gamma\n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var arr = gamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var arr = gamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var rand = gamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var rand = gamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a geometric distribution.\n*\n* ## Proof\n*\n* Consider\n*\n* ```tex\n* N = \\left \\lfloor \\ln (U) / \\ln (1-p) \\right \\rfloor\n* ```\n*\n* where \\\\( U \\\\) is uniform on the interval \\\\((0,1)\\\\). Accordingly, \\\\(N\\\\) must be a nonnegative integer, and, for every \\\\( n \\geq 0\\\\), the event \\\\(A_n = \\left \\{ N = n \\right \\}\\\\) is\n*\n* ```tex\n* A_n = \\left \\{(n+1) \\ln (1-p) < \\ln (U) \\leq n \\ln (1-p) \\right \\}\n* ```\n*\n* where \\\\(\\ln (1-p) < 0\\\\). Thus,\n*\n* ```tex\n* A_n = \\left \\{(1-p)^{n+1} < U \\leq (1-p)^n \\right \\}\n* ```\n*\n* For every \\\\(u < v\\\\) on the interval \\\\((0,1)\\\\),\n*\n* ```tex\n* P\\left \\[u < U \\leq v\\right \\] = v - u\n* ```\n*\n* Hence,\n*\n* ```tex\n* P\\left \\[N = n \\right \\] = P\\left \\[A_n\\right \\] = (1-p)^n - (1-p)^{n+1} = (1-p)^n(1-(1-p)) = p(1-p)^n\n* ```\n*\n* which proves that \\\\(N\\\\) is a geometric random variable.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction geometric( rand, p ) {\n\tvar u = rand();\n\tif ( u === 0.0 ) {\n\t\t// Drawing random variates from a PRNG (with period > 1) is effectively sampling without replacement. Thus, should not be possible to draw `0` twice in a row.\n\t\tu = rand();\n\t}\n\treturn floor( ln( u ) / ln( 1.0-p ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar geometric0 = require( './geometric.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating geometric distributed random numbers.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var geometric = factory( 0.5 );\n* var v = geometric();\n* // returns \n*\n* @example\n* var geometric = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = geometric();\n* // returns \n*\n* @example\n* var geometric = factory();\n* var v = geometric( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tp = arguments[ 0 ];\n\t\tif ( !isProbability( p ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( p === void 0 ) {\n\t\tprng = geometric2;\n\t} else {\n\t\tprng = geometric1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'geometric' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( p === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a geometric distribution with bound parameter `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = geometric1();\n\t* // returns \n\t*/\n\tfunction geometric1() {\n\t\treturn geometric0( rand, p );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a geometric distribution with parameter `p`.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = geometric2( 0.5 );\n\t* // returns \n\t*/\n\tfunction geometric2( p ) {\n\t\tif (\n\t\t\tisnan( p ) ||\n\t\t\tp < 0.0 ||\n\t\t\tp > 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn geometric0( rand, p );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom random number drawn from a geometric distribution with parameter `p`.\n*\n* @name geometric\n* @type {PRNG}\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = geometric( 0.5 );\n* // returns \n*\n* @example\n* var v = geometric( 3.14 );\n* // returns NaN\n*\n* @example\n* var v = geometric( -1.0 );\n* // returns NaN\n*\n* @example\n* var v = geometric( NaN );\n* // returns NaN\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Geometric distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/geometric\n*\n* @example\n* var geometric = require( '@stdlib/random/base/geometric' );\n*\n* var v = geometric( 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/geometric' ).factory;\n*\n* var geometric = factory( 0.3, {\n* 'seed': 297\n* });\n*\n* var v = geometric();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/geometric' ).factory;\n*\n* var geometric = factory({\n* 'seed': 297\n* });\n*\n* var v = geometric( 0.5 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/geometric' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar unary = require( '@stdlib/strided/base/unary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {PositiveNumber} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `p` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var geometric = factory( 0.3 );\n* // returns \n*\n* var arr = geometric( 10 );\n* // returns \n*\n* @example\n* var geometric = factory( 0.3 );\n* // returns \n*\n* var arr = geometric( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = geometric2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\tif ( isNumber( options ) ) {\n\t\t\trand = geometric1;\n\t\t} else {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\trand = geometric2;\n\t\t}\n\t} else if ( nargs === 2 ) {\n\t\toptions = arguments[ 1 ];\n\t\tprng = base.factory( arguments[ 0 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = geometric1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a geometric distribution with parameters `p`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction geometric1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a geometric distribution with parameters `p` (success probability).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {PositiveNumber} p - success probability\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction geometric2( len, p, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 2 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tunary( [ [ p ], out ], [ len ], [ 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( p );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a geometric distribution with parameter `p` (success probability).\n*\n* @name geometric\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = geometric( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = geometric( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a geometric distribution with parameters `p` (success probability).\n*\n* @module @stdlib/random/array/geometric\n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var arr = geometric( 10, 2.0 );\n* // returns \n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var arr = geometric( 10, 2.0,, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var rand = geometric.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var rand = geometric.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar gamma = require( './../../../base/gamma' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating inverse gamma distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var invgamma = factory( 2.0, 1.0 );\n* var v = invgamma();\n* // returns \n*\n* @example\n* var invgamma = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = invgamma();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gamma();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trgamma = gamma( alpha, beta, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trgamma = gamma( alpha, beta, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trgamma = gamma( alpha, beta );\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = invgamma2;\n\t} else {\n\t\tprng = invgamma1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'invgamma' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma1();\n\t* // returns \n\t*/\n\tfunction invgamma1() {\n\t\treturn 1.0 / rgamma();\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma2( 2.0, 1.0 );\n\t* // returns \n\t*/\n\tfunction invgamma2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn 1.0 / rgamma( alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from an inverse gamma distribution.\n*\n* ## Method\n*\n* When\n*\n* ```tex\n* X \\sim \\operatorname{Gamma}( \\alpha, \\beta )\n* ```\n*\n* then\n*\n* ```tex\n* \\frac{1}{X} \\sim \\operatorname{InvGamma}\\left( \\alpha, \\tfrac{1}{beta} \\right)\n* ```\n*\n* Hence, to generate a draw from an inverse gamma distribution with parameters \\\\( \\alpha \\\\) and \\\\( \\beta \\\\), sample `X` from a \\\\( \\operatorname{Gamma}\\left( \\alpha, \\tfrac{1}{\\beta} \\right) \\\\) distribution and return `1/X`.\n*\n* @name invgamma\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = invgamma( 2.0, 1.0 );\n* // returns \n*\n* @example\n* var v = invgamma( -2.0, 5.0 );\n* // returns NaN\n*/\nvar invgamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Inverse gamma distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/invgamma\n*\n* @example\n* var invgamma = require( '@stdlib/random/base/invgamma' );\n*\n* var v = invgamma( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/invgamma' ).factory;\n* var invgamma = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = invgamma();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/invgamma' ).factory;\n* var invgamma = factory({\n* 'seed': 297\n* });\n*\n* var v = invgamma( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/invgamma' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var invgamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = invgamma( 10 );\n* // returns \n*\n* @example\n* var invgamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = invgamma( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = invgamma2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = invgamma2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = invgamma1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = invgamma1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from an inverse gamma distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction invgamma1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from an inverse gamma distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction invgamma2( len, alpha, beta, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ alpha ], [ beta ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( alpha, beta );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an inverse gamma distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter).\n*\n* @name invgamma\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = invgamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = invgamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar invgamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from an inverse gamma distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter).\n*\n* @module @stdlib/random/array/invgamma\n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var arr = invgamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var arr = invgamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var rand = invgamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var rand = invgamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale paramter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, sigma ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar exp = require( '@stdlib/math/base/special/exp' );\n\n\n// MAIN //\n\n/**\n* Returns a log-normally distributed pseudorandom number.\n*\n* @private\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction lognormal( randn, mu, sigma ) {\n\treturn exp( mu + (sigma*randn()) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar lognormal0 = require( './lognormal.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var lognormal = factory( 0.0, 1.0 );\n*\n* var v = lognormal();\n* // returns \n*\n* @example\n* var lognormal = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = lognormal();\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tsigma = arguments[ 1 ];\n\t\terr = validate( mu, sigma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = lognormal2;\n\t} else {\n\t\tprng = lognormal1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'lognormal' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a log-normally distributed pseudorandom number with bound parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = lognormal1();\n\t* // returns \n\t*/\n\tfunction lognormal1() {\n\t\treturn lognormal0( rnorm, mu, sigma );\n\t}\n\n\t/**\n\t* Returns a log-normally distributed pseudorandom number with parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = lognormal2( -2.0, 4.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = lognormal2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction lognormal2( mu, sigma ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn lognormal0( rnorm, mu, sigma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a log-normally distributed pseudorandom number with parameters `mu` and `sigma`.\n*\n* @name lognormal\n* @type {PRNG}\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var v = lognormal( -2.0, 4.0 );\n* // returns \n*\n* @example\n* var v = lognormal( 0.0, -1.0 );\n* // returns NaN\n*/\nvar lognormal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Log-normal distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/lognormal\n*\n* @example\n* var lognormal = require( '@stdlib/random/base/lognormal' );\n*\n* var v = lognormal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/lognormal' ).factory;\n* var lognormal = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = lognormal();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/lognormal' ).factory;\n* var lognormal = factory({\n* 'seed': 297\n* });\n*\n* var v = lognormal( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/lognormal' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var lognormal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = lognormal( 10 );\n* // returns \n*\n* @example\n* var lognormal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = lognormal( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = lognormal2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = lognormal2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = lognormal1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = lognormal1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a lognormal distribution with parameters `mu` (location parameter) and `sigma` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction lognormal1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a lognormal distribution with parameters `mu` (location parameter) and `sigma` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction lognormal2( len, mu, sigma, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ mu ], [ sigma ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( mu, sigma );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a lognormal distribution with parameters `mu` (location parameter) and `sigma` (scale parameter).\n*\n* @name lognormal\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = lognormal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = lognormal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar lognormal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a lognormal distribution with parameters `mu` (location parameter) and `sigma` (scale parameter).\n*\n* @module @stdlib/random/array/lognormal\n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var arr = lognormal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var arr = lognormal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var rand = lognormal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var rand = lognormal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = INT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\([1, 2^{31}-1)\\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randint32();\n* // returns \n*/\nfunction randint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = randint32;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isInt32Array = require( '@stdlib/assert/is-int32array' );\nvar format = require( '@stdlib/string/format' );\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// VARIABLES //\n\nvar NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation\nvar MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation\nvar A = 16807|0; // asm type annotation\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 2; // state, seed\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = 4; // | version | num_sections | state_length | ...state | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = 5; // 1 (version) + 1 (num_sections) + 1 (state_length) + 1 (state) + 1 (seed_length)\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Int32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"state\" section must equal `1`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== 1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, 1, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n\n// MAIN //\n\n/**\n* Returns a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} a seed must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer\n* @throws {TypeError} state must be an `Int32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} LCG PRNG\n*\n* @example\n* var minstd = factory();\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* // Return a seeded LCG:\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isInt32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an Int32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Int32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state \"view\":\n\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed |= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) && seed.length > 0 ) {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = 1;\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state \"view\":\n\t\t\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate[ 0 ] = seed[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randint32()|0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randint32()|0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate[ 0 ] = seed[ 0 ];\n\t}\n\tsetReadOnly( minstd, 'NAME', 'minstd' );\n\tsetReadOnlyAccessor( minstd, 'seed', getSeed );\n\tsetReadOnlyAccessor( minstd, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( minstd, 'state', getState, setState );\n\tsetReadOnlyAccessor( minstd, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( minstd, 'byteLength', getStateSize );\n\tsetReadOnly( minstd, 'toJSON', toJSON );\n\tsetReadOnly( minstd, 'MIN', 1 );\n\tsetReadOnly( minstd, 'MAX', INT32_MAX-1 );\n\tsetReadOnly( minstd, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', minstd.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', (minstd.MIN-1.0) / NORMALIZATION_CONSTANT );\n\tsetReadOnly( normalized, 'MAX', (minstd.MAX-1.0) / NORMALIZATION_CONSTANT );\n\n\treturn minstd;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `2` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. internal PRNG state\n\t* 2. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `2`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - If PRNG state is \"shared\" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {TypeError} must provide an `Int32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isInt32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an Int32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Int32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = minstd.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*/\n\tfunction minstd() {\n\t\tvar s = state[ 0 ]|0; // asm type annotation\n\t\ts = ( (A*s)%INT32_MAX )|0; // asm type annotation\n\t\tstate[ 0 ] = s;\n\t\treturn s|0; // asm type annotation\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*/\n\tfunction normalized() {\n\t\treturn (minstd()-1) / NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n*\n* ## Method\n*\n* Linear congruential generators (LCGs) use the recurrence relation\n*\n* ```tex\n* X_{n+1} = ( a \\cdot X_n + c ) \\operatorname{mod}(m)\n* ```\n*\n* where the modulus \\\\( m \\\\) is a prime number or power of a prime number and \\\\( a \\\\) is a primitive root modulo \\\\( m \\\\).\n*\n* \n*\n* For an LCG to be a Lehmer RNG, the seed \\\\( X_0 \\\\) must be coprime to \\\\( m \\\\).\n*\n* \n*\n* In this implementation, the constants \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) have the values\n*\n* ```tex\n* \\begin{align*}\n* a &= 7^5 = 16807 \\\\\n* c &= 0 \\\\\n* m &= 2^{31} - 1 = 2147483647\n* \\end{align*}\n* ```\n*\n* \n*\n* The constant \\\\( m \\\\) is a Mersenne prime (modulo \\\\(31\\\\)).\n*\n* \n*\n* \n*\n* The constant \\\\( a \\\\) is a primitive root (modulo \\\\(31\\\\)).\n*\n* \n*\n* Accordingly, the maximum possible product is\n*\n* ```tex\n* 16807 \\cdot (m - 1) \\approx 2^{46}\n* ```\n*\n* The values for \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) are taken from Park and Miller, \"Random Number Generators: Good Ones Are Hard To Find\". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.\n*\n*\n* ## Notes\n*\n* - The generator has a period of approximately \\\\(2.1\\mbox{e}9\\\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).\n*\n*\n* ## References\n*\n* - Park, S. K., and K. W. Miller. 1988. \"Random Number Generators: Good Ones Are Hard to Find.\" _Communications of the ACM_ 31 (10). New York, NY, USA: ACM: 1192\u20131201. doi:[10.1145/63039.63042](http://dx.doi.org/10.1145/63039.63042).\n* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.\n*\n*\n* @function minstd\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = minstd();\n* // returns \n*/\nvar minstd = factory({\n\t'seed': randint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/base/minstd\n*\n* @example\n* var minstd = require( '@stdlib/random/base/minstd' );\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/minstd' ).factory;\n*\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/minstd' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = minstd;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction minstd( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Int32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Int32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Int32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @name minstd\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar minstd = factory();\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @module @stdlib/random/array/minstd\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// VARIABLES //\n\nvar NUM_WARMUPS = 8;\n\n\n// MAIN //\n\n/**\n* Initializes a shuffle table.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {Int32Array} table - table\n* @param {PositiveInteger} N - table size\n* @throws {Error} PRNG returned `NaN`\n* @returns {NumberArray} shuffle table\n*/\nfunction createTable( rand, table, N ) {\n\tvar v;\n\tvar i;\n\n\t// \"warm-up\" the PRNG...\n\tfor ( i = 0; i < NUM_WARMUPS; i++ ) {\n\t\tv = rand();\n\n\t\t// Prevent the above loop from being discarded by the compiler...\n\t\tif ( isnan( v ) ) {\n\t\t\tthrow new Error( 'unexpected error. PRNG returned NaN.' );\n\t\t}\n\t}\n\t// Initialize the shuffle table...\n\tfor ( i = N-1; i >= 0; i-- ) {\n\t\ttable[ i ] = rand();\n\t}\n\treturn table;\n}\n\n\n// EXPORTS //\n\nmodule.exports = createTable;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = INT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\([1, 2^{31}-1)\\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randint32();\n* // returns \n*/\nfunction randint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = randint32;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isInt32Array = require( '@stdlib/assert/is-int32array' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar createTable = require( './create_table.js' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// VARIABLES //\n\nvar NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation\nvar MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation\nvar A = 16807|0; // asm type annotation\n\n// Define the number of elements in the shuffle table:\nvar TABLE_LENGTH = 32;\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 3; // table, other, seed\n\n// Define the index offset of the \"table\" section in the state array:\nvar TABLE_SECTION_OFFSET = 2; // | version | num_sections | table_length | ...table | other_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = TABLE_LENGTH + 3; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = TABLE_LENGTH + 6; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = TABLE_LENGTH + 7; // 1 (version) + 1 (num_sections) + 1 (table_length) + TABLE_LENGTH (table) + 1 (state_length) + 1 (shuffle_state) + 1 (prng_state) + 1 (seed_length)\n\n// Define the indices for the shuffle table and PRNG states:\nvar SHUFFLE_STATE = STATE_SECTION_OFFSET + 1;\nvar PRNG_STATE = STATE_SECTION_OFFSET + 2;\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Int32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"table\" section must equal `TABLE_LENGTH`...\n\tif ( state[ TABLE_SECTION_OFFSET ] !== TABLE_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible table length. Expected: `%s`. Actual: `%s`.', s1, TABLE_LENGTH, state[ TABLE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"state\" section must equal `2`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== 2 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, 2, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n\n// MAIN //\n\n/**\n* Returns a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} a seed must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer\n* @throws {TypeError} state must be an `Int32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} shuffled LCG PRNG\n*\n* @example\n* var minstd = factory();\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* // Return a seeded LCG:\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 1421600654\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isInt32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an Int32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Int32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state (table) \"view\":\n\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed |= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) && seed.length > 0 ) {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = 2;\n\t\t\t\t\tSTATE[ PRNG_STATE ] = seed[ 0 ];\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state (table) \"view\":\n\t\t\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate = createTable( minstd, state, TABLE_LENGTH );\n\t\t\t\t\tSTATE[ SHUFFLE_STATE ] = state[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randint32()|0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randint32()|0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = 2;\n\t\tSTATE[ PRNG_STATE ] = seed;\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state (table) \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate = createTable( minstd, state, TABLE_LENGTH );\n\t\tSTATE[ SHUFFLE_STATE ] = state[ 0 ];\n\t}\n\tsetReadOnly( minstdShuffle, 'NAME', 'minstd-shuffle' );\n\tsetReadOnlyAccessor( minstdShuffle, 'seed', getSeed );\n\tsetReadOnlyAccessor( minstdShuffle, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( minstdShuffle, 'state', getState, setState );\n\tsetReadOnlyAccessor( minstdShuffle, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( minstdShuffle, 'byteLength', getStateSize );\n\tsetReadOnly( minstdShuffle, 'toJSON', toJSON );\n\tsetReadOnly( minstdShuffle, 'MIN', 1 );\n\tsetReadOnly( minstdShuffle, 'MAX', INT32_MAX-1 );\n\tsetReadOnly( minstdShuffle, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', minstdShuffle.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', (minstdShuffle.MIN-1.0) / NORMALIZATION_CONSTANT );\n\tsetReadOnly( normalized, 'MAX', (minstdShuffle.MAX-1.0) / NORMALIZATION_CONSTANT );\n\n\treturn minstdShuffle;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `3` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. shuffle table\n\t* 2. internal PRNG state\n\t* 3. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - If PRNG state is \"shared\" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {TypeError} must provide an `Int32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isInt32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an Int32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Int32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state (table) \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = minstdShuffle.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*/\n\tfunction minstd() {\n\t\tvar s = STATE[ PRNG_STATE ]|0; // asm type annotation\n\t\ts = ( (A*s)%INT32_MAX )|0; // asm type annotation\n\t\tSTATE[ PRNG_STATE ] = s;\n\t\treturn s|0; // asm type annotation\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*\n\t* @example\n\t* var v = minstd();\n\t* // returns \n\t*/\n\tfunction minstdShuffle() {\n\t\tvar s;\n\t\tvar i;\n\n\t\ts = STATE[ SHUFFLE_STATE ];\n\t\ti = floor( TABLE_LENGTH * (s/INT32_MAX) );\n\n\t\t// Pull a state from the table:\n\t\ts = state[ i ];\n\n\t\t// Update the PRNG state:\n\t\tSTATE[ SHUFFLE_STATE ] = s;\n\n\t\t// Replace the pulled state:\n\t\tstate[ i ] = minstd();\n\n\t\treturn s;\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normalized();\n\t* // returns \n\t*/\n\tfunction normalized() {\n\t\treturn (minstdShuffle()-1) / NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n*\n* ## Method\n*\n* Linear congruential generators (LCGs) use the recurrence relation\n*\n* ```tex\n* X_{n+1} = ( a \\cdot X_n + c ) \\operatorname{mod}(m)\n* ```\n*\n* where the modulus \\\\( m \\\\) is a prime number or power of a prime number and \\\\( a \\\\) is a primitive root modulo \\\\( m \\\\).\n*\n* \n*\n* For an LCG to be a Lehmer RNG, the seed \\\\( X_0 \\\\) must be coprime to \\\\( m \\\\).\n*\n* \n*\n* In this implementation, the constants \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) have the values\n*\n* ```tex\n* \\begin{align*}\n* a &= 7^5 = 16807 \\\\\n* c &= 0 \\\\\n* m &= 2^{31} - 1 = 2147483647\n* \\end{align*}\n* ```\n*\n* \n*\n* The constant \\\\( m \\\\) is a Mersenne prime (modulo \\\\(31\\\\)).\n*\n* \n*\n* \n*\n* The constant \\\\( a \\\\) is a primitive root (modulo \\\\(31\\\\)).\n*\n* \n*\n* Accordingly, the maximum possible product is\n*\n* ```tex\n* 16807 \\cdot (m - 1) \\approx 2^{46}\n* ```\n*\n* The values for \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) are taken from Park and Miller, \"Random Number Generators: Good Ones Are Hard To Find\". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.\n*\n* This implementation subsequently shuffles the output of a linear congruential pseudorandom number generator (LCG) using a shuffle table in accordance with the Bays-Durham algorithm.\n*\n* ## Notes\n*\n* - The generator has a period of approximately \\\\(2.1\\mbox{e}9\\\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).\n*\n* ## References\n*\n* - Bays, Carter, and S. D. Durham. 1976. \"Improving a Poor Random Number Generator.\" _ACM Transactions on Mathematical Software_ 2 (1). New York, NY, USA: ACM: 59\u201364. doi:[10.1145/355666.355670](http://dx.doi.org/10.1145/355666.355670).\n* - Herzog, T.N., and G. Lord. 2002. _Applications of Monte Carlo Methods to Finance and Insurance_. ACTEX Publications. [https://books.google.com/books?id=vC7I\\\\\\_gdX-A0C](https://books.google.com/books?id=vC7I\\_gdX-A0C).\n* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.\n*\n* @function minstd\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = minstd();\n* // returns \n*/\nvar minstd = factory({\n\t'seed': randint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/base/minstd-shuffle\n*\n* @example\n* var minstd = require( '@stdlib/random/base/minstd-shuffle' );\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/minstd-shuffle' ).factory;\n*\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 1421600654\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/minstd-shuffle' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = minstd;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction minstd( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Int32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Int32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Int32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @name minstd\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar minstd = factory();\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/array/minstd-shuffle\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\n", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/mt19937' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = mt19937;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[0, 4294967295]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction mt19937( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)` with 53-bit precision.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Uint32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Uint32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Uint32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @name mt19937\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var arr = mt19937.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar mt19937 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/array/mt19937\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937.normalized( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var rand = mt19937.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var rand = mt19937.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, sigma ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a pseudorandom number from a normal distribution with parameters `mu` and `sigma`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {number} pseudorandom number\n*/\nfunction normal( rand, mu, sigma ) {\n\treturn mu + (sigma*rand());\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar normal0 = require( './normal.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating normally distributed random numbers.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var normal = factory( 0.0, 1.0 );\n* var v = normal();\n* // returns \n*\n* @example\n* var normal = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = normal();\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tsigma = arguments[ 1 ];\n\t\terr = validate( mu, sigma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = normal2;\n\t} else {\n\t\tprng = normal1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'normal' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a normal distribution with bound parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal1();\n\t* // returns \n\t*/\n\tfunction normal1() {\n\t\treturn normal0( rnorm, mu, sigma );\n\t}\n\n\t/**\n\t* Returns a normally distributed pseudorandom number with mean `mu` and standard deviation `sigma`.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = normal2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction normal2( mu, sigma ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn normal0( rnorm, mu, sigma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a normally distributed pseudorandom number with mean `mu` and standard deviation `sigma`.\n*\n* @name normal\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = normal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var v = normal( 0.0, -1.0 );\n* // returns NaN\n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Normally distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/normal\n*\n* @example\n* var normal = require( '@stdlib/random/base/normal' );\n*\n* var v = normal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/normal' ).factory;\n* var normal = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = normal();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/normal' ).factory;\n* var normal = factory({\n* 'seed': 297\n* });\n*\n* var v = normal( -3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/normal' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var normal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = normal( 10 );\n* // returns \n*\n* @example\n* var normal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = normal( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = normal2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = normal2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = normal1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = normal1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a normal distribution with parameters `mu` (mean) and `sigma` (standard deviation).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normal1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a normal distribution with parameters `mu` (mean) and `sigma` (standard deviation).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normal2( len, mu, sigma, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ mu ], [ sigma ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( mu, sigma );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a normal distribution with parameters `mu` (mean) and `sigma` (standard deviation).\n*\n* @name normal\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = normal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = normal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a normal distribution with parameters `mu` (mean) and `sigma` (standard deviation).\n*\n* @module @stdlib/random/array/normal\n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var arr = normal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var arr = normal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var rand = normal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var rand = normal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "{\n\t\"name\": \"mt19937\",\n\t\"copy\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar minstd = require( './../../../base/minstd' );\nvar minstdShuffle = require( './../../../base/minstd-shuffle' );\nvar mt19937 = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'minstd' ] = minstd;\nprngs[ 'minstd-shuffle' ] = minstdShuffle;\nprngs[ 'mt19937' ] = mt19937;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating uniformly distributed random numbers on the interval \\\\( [0,1) \\\\).\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of pseudorandom number generator\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var uniform = factory();\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'name': 'minstd'\n* });\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'seed': 12345\n* });\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n* var v = uniform();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( opts.seed === void 0 ) {\n\t\t\trand = prng.factory();\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'seed': opts.seed\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'state': opts.state,\n\t\t\t'copy': opts.copy\n\t\t});\n\t}\n\tsetReadOnly( uniform, 'NAME', 'randu' );\n\tsetReadOnlyAccessor( uniform, 'seed', getSeed );\n\tsetReadOnlyAccessor( uniform, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( uniform, 'state', getState, setState );\n\tsetReadOnlyAccessor( uniform, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( uniform, 'byteLength', getStateSize );\n\tsetReadOnly( uniform, 'toJSON', toJSON );\n\tsetReadOnly( uniform, 'PRNG', rand );\n\tsetReadOnly( uniform, 'MIN', rand.normalized.MIN );\n\tsetReadOnly( uniform, 'MAX', rand.normalized.MAX );\n\n\treturn uniform;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = uniform.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform();\n\t* // returns \n\t*/\n\tfunction uniform() {\n\t\treturn rand.normalized();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a uniformly distributed random number on the interval \\\\( [0,1) \\\\).\n*\n* @name randu\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = randu();\n* // returns \n*/\nvar randu = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Uniformly distributed pseudorandom numbers on the interval \\\\( [0,1) \\\\).\n*\n* @module @stdlib/random/base/randu\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* var v = randu();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randu' ).factory;\n*\n* var randu = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n*\n* var v = randu();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/randu' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var randu = factory();\n* // returns \n*\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var randu = factory();\n* // returns \n*\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\trand = randu;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a randu distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction randu( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @name randu\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar randu = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/array/randu\n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var rand = randu.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var rand = randu.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} a - minimum support (inclusive)\n* @param {number} b - maximum support (exclusive)\n* @returns {number} pseudorandom number\n*/\nfunction uniform( rand, a, b ) {\n\tvar r = rand();\n\treturn ( b*r ) + ( (1.0-r)*a ); // equivalent to (b-a)*r + a\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar uniform0 = require( './uniform.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating uniformly distributed random numbers.\n*\n* @param {number} [a] - minimum support (inclusive)\n* @param {number} [b] - maximum support (exclusive)\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var uniform = factory( 0.0, 1.0 );\n*\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory( -3.0, -1.0, {\n* 'seed': 297\n* });\n* var v = uniform();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = uniform2;\n\t} else {\n\t\tprng = uniform1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'uniform' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform1();\n\t* // returns \n\t*/\n\tfunction uniform1() {\n\t\treturn uniform0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support (inclusive)\n\t* @param {number} b - maximum support (exclusive)\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = uniform2( 1.0, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction uniform2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta >= b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn uniform0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @name uniform\n* @type {PRNG}\n* @param {number} a - minimum support (inclusive)\n* @param {number} b - maximum support (exclusive)\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = uniform( 0.0, 1.0 );\n* // returns \n*/\nvar uniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Uniform distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/uniform\n*\n* @example\n* var uniform = require( '@stdlib/random/base/uniform' );\n*\n* var v = uniform( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/uniform' ).factory;\n* var uniform = factory( -5.0, 5.0, {\n* 'seed': 297\n* });\n*\n* var v = uniform();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/uniform' ).factory;\n* var uniform = factory({\n* 'seed': 297\n* });\n*\n* var v = uniform( -5.0, 5.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/uniform' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var uniform = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = uniform( 10 );\n* // returns \n*\n* @example\n* var uniform = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = uniform( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = uniform2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = uniform2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = uniform1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = uniform1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a continuous uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction uniform1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a continuous uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction uniform2( len, a, b, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ a ], [ b ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( a, b );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a continuous uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @name uniform\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = uniform( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = uniform( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar uniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a continuous uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @module @stdlib/random/array/uniform\n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var arr = uniform( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var arr = uniform( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var rand = uniform.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var rand = uniform.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../array/arcsine' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../array/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../array/betaprime' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../array/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../array/discrete-uniform' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../array/exponential' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../array/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../array/geometric' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../array/invgamma' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../array/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../array/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../array/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../array/mt19937' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../array/normal' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../array/randu' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../array/uniform' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Bernoulli distributed random numbers.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var bernoulli = factory( 0.5 );\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var bernoulli = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var bernoulli = factory();\n* var v = bernoulli( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tp = arguments[ 0 ];\n\t\tif ( !isProbability( p ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( p === void 0 ) {\n\t\tprng = bernoulli2;\n\t} else {\n\t\tprng = bernoulli1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'bernoulli' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( p === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Bernoulli distribution with bound parameter `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = bernoulli1();\n\t* // returns \n\t*/\n\tfunction bernoulli1() {\n\t\treturn ( rand() <= p ) ? 1 : 0;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Bernoulli distribution with parameter `p`.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = bernoulli2( 0.5 );\n\t* // returns \n\t*/\n\tfunction bernoulli2( p ) {\n\t\tif (\n\t\t\tisnan( p ) ||\n\t\t\tp < 0.0 ||\n\t\t\tp > 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn ( rand() <= p ) ? 1 : 0;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom random number drawn from a Bernoulli distribution with parameter `p`.\n*\n* @name bernoulli\n* @type {PRNG}\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = bernoulli( 0.5 );\n* // returns \n*\n* @example\n* var v = bernoulli( 3.14 );\n* // returns NaN\n*\n* @example\n* var v = bernoulli( -1.0 );\n* // returns NaN\n*\n* @example\n* var v = bernoulli( NaN );\n* // returns NaN\n*/\nvar bernoulli = factory();\n\n\n// EXPORTS //\n\nmodule.exports = bernoulli;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Bernoulli distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/bernoulli\n*\n* @example\n* var bernoulli = require( '@stdlib/random/base/bernoulli' );\n*\n* var v = bernoulli( 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/bernoulli' ).factory;\n*\n* var bernoulli = factory( 0.3, {\n* 'seed': 297\n* });\n*\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/bernoulli' ).factory;\n*\n* var bernoulli = factory({\n* 'seed': 297\n* });\n*\n* var v = bernoulli( 0.5 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 10, 0.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( n, p ) {\n\tif ( !isPositiveInteger( n ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', p ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generates a binomially distributed pseudorandom number by computing the sum of Bernoulli random variables.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tvar sum = 0;\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tif ( rand() <= p ) {\n\t\t\tsum += 1;\n\t\t}\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// VARIABLES //\n\nvar ONE_12 = 1.0 / 12.0;\nvar ONE_360 = 1.0 / 360.0;\nvar ONE_1260 = 1.0 / 1260.0;\n\n\n// MAIN //\n\n/**\n* Returns a correction for Stirling's approximation.\n*\n* @private\n* @param {NonNegativeInteger} k - input argument\n* @returns {number} correction term\n*\n* @example\n* var c = correction( 0 );\n* // returns 0.08106146679532726\n*/\nfunction correction( k ) {\n\tvar v;\n\tswitch ( k ) {\n\tcase 0:\n\t\treturn 0.08106146679532726;\n\tcase 1:\n\t\treturn 0.04134069595540929;\n\tcase 2:\n\t\treturn 0.02767792568499834;\n\tcase 3:\n\t\treturn 0.02079067210376509;\n\tcase 4:\n\t\treturn 0.01664469118982119;\n\tcase 5:\n\t\treturn 0.01387612882307075;\n\tcase 6:\n\t\treturn 0.01189670994589177;\n\tcase 7:\n\t\treturn 0.01041126526197209;\n\tcase 8:\n\t\treturn 0.009255462182712733;\n\tcase 9:\n\t\treturn 0.008330563433362871;\n\tdefault:\n\t\tk += 1;\n\t\tv = pow( k, 2 );\n\t\treturn (ONE_12 - ((ONE_360 - (ONE_1260/v)) / v)) / k;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = correction;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar correction = require( './correction.js' );\n\n\n// VARIABLES //\n\nvar ONE_SIXTH = 1.0 / 6.0;\n\n\n// MAIN //\n\n/**\n* Generates a binomially distributed pseudorandom number.\n*\n* ## References\n*\n* - H\u00F6rmann, Wolfgang. 1993. \"The generation of binomial random variates.\" _Journal of Statistical Computation and Simulation_ 46 (1-2): 101\u201310. doi:[10.1080/00949659308811496][@hormann:1993a].\n*\n* [@hormann:1993a]: http://dx.doi.org/10.1080/00949659308811496\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tvar alpha;\n\tvar urvr;\n\tvar snpq;\n\tvar npq;\n\tvar rho;\n\tvar tmp;\n\tvar nm;\n\tvar nr;\n\tvar us;\n\tvar km;\n\tvar nk;\n\tvar vr;\n\tvar a;\n\tvar b;\n\tvar c;\n\tvar f;\n\tvar h;\n\tvar i;\n\tvar k;\n\tvar m;\n\tvar q;\n\tvar r;\n\tvar t;\n\tvar u;\n\tvar v;\n\tvar x;\n\n\tm = floor( (n + 1) * p );\n\tnm = n - m + 1;\n\n\tq = 1.0 - p;\n\n\tr = p / q;\n\tnr = (n + 1) * r;\n\n\tnpq = n * p * q;\n\tsnpq = sqrt( npq );\n\n\tb = 1.15 + (2.53 * snpq);\n\ta = -0.0873 + (0.0248*b) + (0.01*p);\n\tc = (n*p) + 0.5;\n\n\talpha = (2.83 + (5.1/b)) * snpq;\n\n\tvr = 0.92 - (4.2/b);\n\turvr = 0.86 * vr;\n\n\th = (m + 0.5) * ln( (m+1) / (r*nm) );\n\th += correction( m ) + correction( n-m );\n\n\twhile ( true ) {\n\t\tv = rand();\n\t\tif ( v <= urvr ) {\n\t\t\tu = (v/vr) - 0.43;\n\t\t\tr = (u * ( (2.0*a / (0.5 - abs(u))) + b )) + c;\n\t\t\treturn floor( r );\n\t\t}\n\t\tif ( v >= vr ) {\n\t\t\tu = rand() - 0.5;\n\t\t} else {\n\t\t\tu = (v/vr) - 0.93;\n\t\t\tu = (sign( u ) * 0.5) - u;\n\t\t\tv = vr * rand();\n\t\t}\n\t\tus = 0.5 - abs(u);\n\t\tk = floor( (u * ( (2.0*a/us) + b )) + c );\n\t\tif ( k < 0 || k > n ) {\n\t\t\t// Try again...\n\t\t\tcontinue;\n\t\t}\n\t\tv = v * alpha / ( (a/(us*us)) + b );\n\t\tkm = abs( k - m );\n\t\tif ( km > 15 ) {\n\t\t\tv = ln( v );\n\t\t\trho = km / npq;\n\t\t\ttmp = ( (km/3) + 0.625 ) * km;\n\t\t\ttmp += ONE_SIXTH;\n\t\t\ttmp /= npq;\n\t\t\trho *= tmp + 0.5;\n\t\t\tt = -(km * km) / (2.0 * npq);\n\t\t\tif ( v < t - rho ) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tif ( v <= t + rho ) {\n\t\t\t\tnk = n - k + 1;\n\t\t\t\tx = h + ( (n+1)*ln( nm/nk ) );\n\t\t\t\tx += (k+0.5) * ln( nk*r/(k+1) );\n\t\t\t\tx += -(correction( k ) + correction( n-k ));\n\t\t\t\tif ( v <= x ) {\n\t\t\t\t\treturn k;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tf = 1.0;\n\t\t\tif ( m < k ) {\n\t\t\t\tfor ( i = m; i <= k; i++ ) {\n\t\t\t\t\tf *= (nr/i) - r;\n\t\t\t\t}\n\t\t\t} else if ( m > k ) {\n\t\t\t\tfor ( i = k; i <= m; i++ ) {\n\t\t\t\t\tv *= (nr/i) - r;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( v <= f ) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sample1 = require( './sample1.js' );\nvar sample2 = require( './sample2.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a binomial distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - probability of success\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tif ( p > 0.5 ) {\n\t\treturn n - sample( rand, n, 1.0-p );\n\t}\n\tif ( n*p < 10.0 ) {\n\t\treturn sample1( rand, n, p );\n\t}\n\treturn sample2( rand, n, p );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' );\nvar isProbability = require( '@stdlib/math/base/assert/is-probability' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar binomial0 = require( './binomial.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating binomially distributed random numbers.\n*\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var binomial = factory( 17, 0.5 );\n* var v = binomial();\n* // returns \n*\n* @example\n* var binomial = factory( 8, 0.8, {\n* 'seed': 297\n* });\n* var v = binomial();\n* // returns \n*\n* @example\n* var binomial = factory();\n* var v = binomial( 20, 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar n;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tn = arguments[ 0 ];\n\t\tp = arguments[ 1 ];\n\t\terr = validate( n, p );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( n === void 0 ) {\n\t\tprng = binomial2;\n\t}\n\telse {\n\t\tprng = binomial1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'binomial' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( n === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ n, p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a binomial distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var r = binomial1();\n\t* // returns \n\t*/\n\tfunction binomial1() {\n\t\treturn binomial0( rand, n, p );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} n - number of trials\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var r = binomial2( 20, 0.8 );\n\t* // returns \n\t*/\n\tfunction binomial2( n, p ) {\n\t\tif (\n\t\t\tisnan( n ) ||\n\t\t\tisnan( p ) ||\n\t\t\t!isPositiveInteger( n ) ||\n\t\t\t!isProbability( p )\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn binomial0( rand, n, p );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a binomially distributed random number.\n*\n* ## Method\n*\n* - For \\\\(np < 10\\\\), the function generates Bernoulli random variates and returns their sum.\n* - For \\\\(np \\geq 10\\\\), the function uses the [BTRD algorithm][@hormann:1993a].\n*\n* ## References\n*\n* - H\u00F6rmann, Wolfgang. 1993. \"The generation of binomial random variates.\" _Journal of Statistical Computation and Simulation_ 46 (1-2): 101\u201310. doi:[10.1080/00949659308811496][@hormann:1993a].\n*\n* [@hormann:1993a]: http://dx.doi.org/10.1080/00949659308811496\n*\n* @name binomial\n* @type {PRNG}\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var r = binomial( 20, 0.8 );\n* // returns \n*/\nvar binomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = binomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Binomial distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/binomial\n*\n* @example\n* var binomial = require( '@stdlib/random/base/binomial' );\n*\n* var v = binomial( 20, 0.4 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/binomial' ).factory;\n*\n* var binomial = factory( 90, 0.8, {\n* 'seed': 297\n* });\n*\n* var v = binomial();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar sin = require( '@stdlib/math/base/special/sin' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar TWO_PI = require( '@stdlib/constants/float64/two-pi' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating standard normally distributed pseudorandom numbers using the Box-Muller algorithm.\n*\n* @private\n* @param {PRNG} rand - PRNG which returns standard uniformly distributed numbers\n* @returns {PRNG} PRNG\n*/\nfunction wrap( rand ) {\n\tvar flg;\n\tvar r;\n\n\t// Flag indicating whether to generate new normal random variates or return a cached normal random variate:\n\tflg = true;\n\n\treturn randn;\n\n\t/**\n\t* Generates a standard normally distributed pseudorandom number.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = randn();\n\t* // returns \n\t*/\n\tfunction randn() {\n\t\tvar u1;\n\t\tvar u2;\n\t\tvar a;\n\t\tvar b;\n\t\tif ( flg ) {\n\t\t\t// Note: if `u1` is `0`, the natural log blows up, so we keep trying until we get a non-zero rand. Rarely should we need more than one iteration.\n\t\t\tdo {\n\t\t\t\tu1 = rand();\n\t\t\t\tu2 = rand();\n\t\t\t} while (\n\t\t\t\tu1 === 0.0\n\t\t\t);\n\t\t\ta = sqrt( -2.0 * ln(u1) );\n\t\t\tb = TWO_PI * u2;\n\t\t\tr = a * cos( b ); // cache for next call\n\t\t\tflg = false;\n\t\t\treturn a * sin( b );\n\t\t}\n\t\tflg = true;\n\t\treturn r;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar PI = require( '@stdlib/constants/float64/pi' );\n\n\n// VARIABLES //\n\nvar COS_PI = cos( PI ); // -1\n\n\n// MAIN //\n\n/**\n* Returns the minimum possible normally distributed pseudorandom number.\n*\n* @private\n* @param {number} min - minimum possible uniformly distributed pseudorandom number\n* @returns {number} minimum possible number\n*/\nfunction getMin( min ) {\n\tvar a = sqrt( -2.0 * ln( min ) );\n\treturn a * COS_PI;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getMin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar TWO_PI = require( '@stdlib/constants/float64/two-pi' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum possible normally distributed pseudorandom number.\n*\n* @private\n* @param {number} min - minimum possible uniformly distributed pseudorandom number\n* @returns {number} maximum possible number\n*/\nfunction getMax( min ) {\n\tvar a = sqrt( -2.0 * ln( min ) );\n\tvar b = TWO_PI * min;\n\treturn a * cos( b );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getMax;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar randn0 = require( './randn.js' );\nvar getMin = require( './min.js' );\nvar getMax = require( './max.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the Box-Muller transform to generate standard normally distributed pseudorandom numbers.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var r = randn();\n* // returns \n*\n* @example\n* // Return a seeded PRNG:\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar randu;\n\tvar randn;\n\tvar rand;\n\tvar opts;\n\n\topts = {\n\t\t'copy': true\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\t\tif ( !isFunction( options.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', options.prng ) );\n\t\t\t}\n\t\t\trandu = options.prng;\n\t\t}\n\t\t// If provided a PRNG, ignore the `state` option, as we don't support getting or setting PRNG state.\n\t\telse if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( !isUint32Array( options.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', options.state ) );\n\t\t\t}\n\t\t}\n\t\t// If provided a PRNG, ignore the `seed` option, as a `seed`, by itself, is insufficient to guarantee reproducibility. If provided a state, ignore the `seed` option, as a PRNG state should contain seed information.\n\t\telse if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( options.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', options.seed ) );\n\t\t\t}\n\t\t}\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( randu === void 0 ) {\n\t\t\trand = mt19937( opts );\n\t\t\trandu = rand.normalized;\n\t\t} else {\n\t\t\topts.seed = null;\n\t\t}\n\t} else {\n\t\trand = mt19937( opts );\n\t\trandu = rand.normalized;\n\t}\n\trandn = randn0( randu );\n\n\tsetReadOnly( randn, 'NAME', 'box-muller' );\n\tif ( opts.seed === null ) {\n\t\tsetReadOnly( randn, 'seed', null );\n\t\tsetReadOnly( randn, 'seedLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( randn, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( randn, 'seedLength', getSeedLength );\n\t}\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( options && options.prng ) {\n\t\tsetReadWriteAccessor( randn, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( randn, 'stateLength', null );\n\t\tsetReadOnly( randn, 'byteLength', null );\n\t\tsetReadOnly( randn, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadWriteAccessor( randn, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( randn, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( randn, 'byteLength', getStateSize );\n\t\tsetReadOnly( randn, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( randn, 'PRNG', randu );\n\n\tif ( hasOwnProp( randu, 'MIN' ) ) {\n\t\tsetReadOnly( randn, 'MIN', getMin( randu.MIN ) );\n\t\tsetReadOnly( randn, 'MAX', getMax( randu.MIN ) );\n\t} else {\n\t\tsetReadOnly( randn, 'MIN', null );\n\t\tsetReadOnly( randn, 'MAX', null );\n\t}\n\n\treturn randn;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = randn.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a standard normally distributed random number.\n*\n* ## Method\n*\n* - Given two independent uniformly distributed random variables \\\\( U_1 \\\\) and \\\\( U_2 \\\\) in the interval \\\\( [0,1) \\\\), let\n*\n* ``` tex\n* \\begin{align*}\n* Z_1 &= R \\cos(\\theta) = \\sqrt{-2 \\ln(U_1)} \\cos(2\\pi U_2) \\\\\n* Z_2 &= R \\sin(\\theta) = \\sqrt{-2 \\ln(U_1)} \\sin(2\\pi U_2)\n* \\end{align*}\n* ```\n*\n* where \\\\( Z_1 \\\\) and \\\\( Z_2 \\\\) are independent random variables with a standard normal distribution.\n*\n* - As two uniform random variates are mapped to two standard normal random variates, one of the random variates is cached and returned upon the following invocation.\n*\n* ## Notes\n*\n* - The minimum and maximum pseudorandom numbers which can be generated are dependent on the number of bits an underlying uniform pseudorandom number generator (PRNG) uses. For instance, if a PRNG uses \\\\( 32 \\\\) bits, the smallest non-zero number that can be generated is \\\\( 2^{-32}). When \\\\( U_1 \\\\) equals this value and \\\\( U_2 \\\\) equals \\\\( 0 \\\\),\n*\n* ``` tex\n* r = \\sqrt{-2\\ln(2^{-32})} \\cos(2\\pi) \\approx 6.66\n* ```\n*\n* which means that the algorithm cannot produce random variates more than \\\\( 6.66 \\\\) standard deviations from the mean.\n*\n* \n*\n* This corresponds to a \\\\( 2.74 \\times 10^{-11} \\\\) loss due to tail truncation.\n*\n* \n*\n* ## References\n*\n* - Box, G. E. P., and Mervin E. Muller. 1958. \"A Note on the Generation of Random Normal Deviates.\" _The Annals of Mathematical Statistics_ 29 (2). The Institute of Mathematical Statistics: 610\u201311. doi:[10.1214/aoms/1177706645](http://dx.doi.org/10.1214/aoms/1177706645).\n* - Bell, James R. 1968. \"Algorithm 334: Normal Random Deviates.\" _Communications of the ACM_ 11 (7). New York, NY, USA: ACM: 498. doi:[10.1145/363397.363547](http://dx.doi.org/10.1145/363397.363547).\n* - Knop, R. 1969. \"Remark on Algorithm 334 \\[G5]: Normal Random Deviates.\" _Communications of the ACM_ 12 (5). New York, NY, USA: ACM: 281. doi:[10.1145/362946.362996](http://dx.doi.org/10.1145/362946.362996).\n* - Marsaglia, G., and T. A. Bray. 1964. \"A Convenient Method for Generating Normal Variables.\" _SIAM Review_ 6 (3). Society for Industrial; Applied Mathematics: 260\u201364. doi:[10.1137/1006063](http://dx.doi.org/10.1137/1006063).\n* - Thomas, David B., Wayne Luk, Philip H.W. Leong, and John D. Villasenor. 2007. \"Gaussian Random Number Generators.\" _ACM Computing Surveys_ 39 (4). New York, NY, USA: ACM. doi:[10.1145/1287620.1287622](http://dx.doi.org/10.1145/1287620.1287622).\n*\n* @name randn\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var r = randn();\n* // returns \n*/\nvar randn = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Normally distributed pseudorandom numbers using the Box-Muller transform.\n*\n* @module @stdlib/random/base/box-muller\n*\n* @example\n* var randn = require( '@stdlib/random/base/box-muller' );\n*\n* var r = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/box-muller' ).factory;\n*\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( x0, gamma ) {\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositive( gamma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar tan = require( '@stdlib/math/base/special/tan' );\nvar PI = require( '@stdlib/constants/float64/pi' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Cauchy distribution.\n*\n* @private\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction cauchy( randn, x0, gamma ) {\n\treturn x0 + ( gamma*tan( PI*( randn()-0.5 ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar cauchy0 = require( './cauchy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Cauchy distribution.\n*\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var cauchy = factory( 0.0, 1.0 );\n* var v = cauchy();\n* // returns \n*\n* @example\n* var cauchy = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = cauchy();\n* // returns \n*/\nfunction factory() {\n\tvar gamma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar x0;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tx0 = arguments[ 0 ];\n\t\tgamma = arguments[ 1 ];\n\t\terr = validate( x0, gamma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( x0 === void 0 ) {\n\t\tprng = cauchy2;\n\t} else {\n\t\tprng = cauchy1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'cauchy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( x0 === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ x0, gamma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Cauchy distribution with bound parameters `x0` and `gamma`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cauchy1();\n\t* // returns \n\t*/\n\tfunction cauchy1() {\n\t\treturn cauchy0( rnorm, x0, gamma );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @param {number} x0 - location parameter\n\t* @param {PositiveNumber} gamma - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cauchy2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var r = cauchy2( 1.0, -1.5 );\n\t* // returns NaN\n\t*/\n\tfunction cauchy2( x0, gamma ) {\n\t\tif (\n\t\t\tisnan( x0 ) ||\n\t\t\tisnan( gamma ) ||\n\t\t\tgamma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn cauchy0( rnorm, x0, gamma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Cauchy distribution.\n*\n* @name cauchy\n* @type {PRNG}\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = cauchy( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = cauchy( 0.0, -1.0 );\n* // returns NaN\n*/\nvar cauchy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Cauchy distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/cauchy\n*\n* @example\n* var cauchy = require( '@stdlib/random/base/cauchy' );\n*\n* var v = cauchy( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cauchy' ).factory;\n*\n* var cauchy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = cauchy();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar gamma = require( './../../../base/gamma' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating chi-square distributed random numbers.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var chisquare = factory( 2 );\n* var v = chisquare();\n* // returns \n*\n* @example\n* var chisquare = factory( 2, {\n* 'seed': 297\n* });\n* var v = chisquare();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar k;\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gamma();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tif ( !isPositive( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trgamma = gamma( k/2.0, 0.5, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trgamma = gamma( k/2.0, 0.5, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trgamma = gamma( k/2.0, 0.5 );\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = chisquare2;\n\t} else {\n\t\tprng = chisquare1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'chisquare' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi-square distribution with bound `k`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chisquare1();\n\t* // returns \n\t*/\n\tfunction chisquare1() {\n\t\treturn rgamma();\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi-square distribution with degrees of freedom `k`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chisquare2( 2 );\n\t* // returns \n\t*/\n\tfunction chisquare2( k ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tk <= 0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rgamma( k/2.0, 0.5 );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a chi-square distribution with degrees of freedom `k`.\n*\n* @function chisquare\n* @type {PRNG}\n* @param {PositiveNumber} k - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = chisquare( 2 );\n* // returns \n*\n* @example\n* var v = chisquare( 0 );\n* // returns NaN\n*\n* @example\n* var v = chisquare( NaN );\n* // returns NaN\n*/\nvar chisquare = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chisquare;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Chi-square distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/chisquare\n*\n* @example\n* var chisquare = require( '@stdlib/random/base/chisquare' );\n*\n* var v = chisquare( 6 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/chisquare' ).factory;\n*\n* var chisquare = factory( 3, {\n* 'seed': 297\n* });\n*\n* var v = chisquare();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating chi distributed random numbers.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var chi = factory( 2 );\n* var v = chi();\n* // returns \n*\n* @example\n* var chi = factory( 2, {\n* 'seed': 297\n* });\n* var v = chi();\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar k;\n\tif ( arguments.length === 0 ) {\n\t\trchisq = chisquare();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tif ( !isPositive( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trchisq = chisquare( k, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trchisq = chisquare( k, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trchisq = chisquare( k );\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = chi2;\n\t} else {\n\t\tprng = chi1;\n\t}\n\trand = rchisq.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'chi' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi distribution with bound `k`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chi1();\n\t* // returns \n\t*/\n\tfunction chi1() {\n\t\treturn sqrt( rchisq() );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi distribution with degrees of freedom `k`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chi2( 2 );\n\t* // returns \n\t*/\n\tfunction chi2( k ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tk <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn sqrt( rchisq( k ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a chi distribution with degrees of freedom `k`.\n*\n* @name chi\n* @type {PRNG}\n* @param {PositiveNumber} k - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = chi( 2 );\n* // returns \n*\n* @example\n* var v = chi( 0 );\n* // returns NaN\n*\n* @example\n* var v = chi( NaN );\n* // returns NaN\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Chi distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/chi\n*\n* @example\n* var chi = require( '@stdlib/random/base/chi' );\n*\n* var v = chi( 6 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/chi' ).factory;\n*\n* var chi = factory( 3, {\n* 'seed': 297\n* });\n*\n* var v = chi();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 2.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( k, lambda ) {\n\tif ( !isPositiveInteger( k ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositive( lambda ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an Erlang distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = erlang();\n* // returns \n*/\nfunction erlang( rand, k, lambda ) {\n\tvar prod;\n\tvar i;\n\tprod = 1.0;\n\tfor ( i = 0; i < k; i++ ) {\n\t\tprod *= rand();\n\t}\n\treturn -(1.0/lambda) * ln( prod );\n}\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar erlang0 = require( './erlang.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Erlang distributed random numbers.\n*\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var erlang = factory( 2, 1.0 );\n* var v = erlang();\n* // returns \n*\n* @example\n* var erlang = factory( 2, 2.0, {\n* 'seed': 297\n* });\n* var v = erlang();\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar err;\n\tvar k;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tlambda = arguments[ 1 ];\n\t\terr = validate( k, lambda );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = erlang2;\n\t} else {\n\t\tprng = erlang1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'erlang' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k, lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an Erlang distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = erlang1();\n\t* // returns \n\t*/\n\tfunction erlang1() {\n\t\treturn erlang0( rand, k, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} k - shape parameter\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = erlang2( 2, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = erlang2( NaN, 1.0 );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 2, NaN );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 3.14, 1.0 );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 2, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction erlang2( k, lambda ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tisnan( lambda ) ||\n\t\t\t!isPositiveInteger( k ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn erlang0( rand, k, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an Erlang distribution.\n*\n* @name erlang\n* @type {PRNG}\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = erlang( 2, 1.0 );\n* // returns \n*\n* @example\n* var v = erlang( NaN, 1.0 );\n* // returns NaN\n*\n* v = erlang( 2, NaN );\n* // returns NaN\n*\n* v = erlang( 3.14, 1.0 );\n* // returns NaN\n*\n* v = erlang( 3, 0.0 );\n* // returns NaN\n*/\nvar erlang = factory();\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Erlang distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/erlang\n*\n* @example\n* var erlang = require( '@stdlib/random/base/erlang' );\n*\n* var v = erlang( 3, 2.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/erlang' ).factory;\n*\n* var erlang = factory( 8, 5.9, {\n* 'seed': 297\n* });\n*\n* var v = erlang();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( d1, d2 ) {\n\tif ( !isPositive( d1 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositive( d2 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n*\n* @private\n* @param {PRNG} rchisq - PRNG for chi-square distributed numbers\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction f( rchisq, d1, d2 ) {\n\tvar x1 = rchisq( d1 ) / d1;\n\tvar x2 = rchisq( d2 ) / d2;\n\treturn x1 / x2;\n}\n\n\n// EXPORTS //\n\nmodule.exports = f;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar f0 = require( './f.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating F distributed random numbers.\n*\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var f = factory( 1.0, 2.0 );\n* var v = f();\n* // returns \n*\n* @example\n* var f = factory( 0.5, 3.0, {\n* 'seed': 297\n* });\n* var v = f();\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar d1;\n\tvar d2;\n\n\tif ( arguments.length === 0 ) {\n\t\trchisq = chisquare();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( opts );\n\t\t}\n\t} else {\n\t\td1 = arguments[ 0 ];\n\t\td2 = arguments[ 1 ];\n\t\terr = validate( d1, d2 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trchisq = chisquare({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trchisq = chisquare( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trchisq = chisquare();\n\t\t}\n\t}\n\tif ( d1 === void 0 ) {\n\t\tprng = f2;\n\t} else {\n\t\tprng = f1;\n\t}\n\trand = rchisq.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'f' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( d1 === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ d1, d2 ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from an F distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = f1();\n\t* // returns \n\t*/\n\tfunction f1() {\n\t\treturn f0( rchisq, d1, d2 );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} d1 - degrees of freedom\n\t* @param {PositiveNumber} d2 - degrees of freedom\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = f2( 3.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = f2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = f2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = f2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction f2( d1, d2 ) {\n\t\tif (\n\t\t\tisnan( d1 ) ||\n\t\t\tisnan( d2 ) ||\n\t\t\td1 <= 0.0 ||\n\t\t\td2 <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn f0( rchisq, d1, d2 );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n*\n* @name f\n* @type {PRNG}\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = f( 3.0, 2.0 );\n* // returns \n*\n* @example\n* var r = f( -2.0, 5.0 );\n* // returns NaN\n*/\nvar f = factory();\n\n\n// EXPORTS //\n\nmodule.exports = f;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* F distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/f\n*\n* @example\n* var f = require( '@stdlib/random/base/f' );\n*\n* var v = f( 5.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/f' ).factory;\n*\n* var f = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = f();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0, 1.3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, s, m ) {\n\tif ( !isPositiveNumber( alpha ) || isnan( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number and not NaN. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) || isnan( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', m ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} pseudorandom number\n*/\nfunction frechet( rand, alpha, s, m ) {\n\treturn m + ( s * ( pow( -ln( rand() ), -1.0/alpha ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar frechet0 = require( './frechet.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var frechet = factory( 1.0, 1.0, 0.8 );\n* var v = frechet();\n* // returns \n*\n* @example\n* var frechet = factory( 1.0, 1.0, -2.0, {\n* 'seed': 297\n* });\n* var v = frechet();\n* // returns \n*/\nfunction factory() {\n\tvar alpha;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar s;\n\tvar m;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\tm = arguments[ 2 ];\n\t\terr = validate( alpha, s, m );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = frechet2;\n\t} else {\n\t\tprng = frechet1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'frechet' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, s, m ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = frechet1();\n\t* // returns \n\t*/\n\tfunction frechet1() {\n\t\treturn frechet0( rand, alpha, s, m );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {number} m - location parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = frechet2( 2.0, 1.0, 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = frechet2( 1.0, 1.0, 0.5 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = frechet2( 1.0, 2.0, NaN );\n\t* // returns NaN\n\t*/\n\tfunction frechet2( alpha, s, m ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( s ) ||\n\t\t\tisnan( m ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn frechet0( rand, alpha, s, m );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @name frechet\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = frechet( 1.0, 1.0, 0.5 );\n* // returns \n*/\nvar frechet = factory();\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fr\u00E9chet distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/frechet\n*\n* @example\n* var frechet = require( '@stdlib/random/base/frechet' );\n*\n* var v = frechet( 10.0, 10.0, 7.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/frechet' ).factory;\n*\n* var frechet = factory( 5.0, 5.0, 3.0, {\n* 'seed': 643361677\n* });\n*\n* var v = frechet();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/frechet' ).factory;\n*\n* var frechet = factory({\n* 'seed': 643361677\n* });\n*\n* var v = frechet( 5.0, 5.0, 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, beta ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Gumbel distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction gumbel( rand, mu, beta ) {\n\treturn mu - ( beta*ln( -ln( rand() ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar gumbel0 = require( './gumbel.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Gumbel distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var gumbel = factory( 0.0, 1.0 );\n* var v = gumbel();\n* // returns \n*\n* @example\n* var gumbel = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = gumbel();\n* // returns \n*/\nfunction factory() {\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( mu, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = gumbel2;\n\t} else {\n\t\tprng = gumbel1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'gumbel' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Gumbel distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = gumbel1();\n\t* // returns \n\t*/\n\tfunction gumbel1() {\n\t\treturn gumbel0( rand, mu, beta );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = gumbel2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = gumbel2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction gumbel2( mu, beta ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( beta ) ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn gumbel0( rand, mu, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Gumbel distribution.\n*\n* @name gumbel\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = gumbel( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = gumbel( 0.0, -1.0 );\n* // returns NaN\n*/\nvar gumbel = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Gumbel distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/gumbel\n*\n* @example\n* var gumbel = require( '@stdlib/random/base/gumbel' );\n*\n* var v = gumbel( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gumbel' ).factory;\n*\n* var gumbel = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = gumbel();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gumbel' ).factory;\n*\n* var gumbel = factory({\n* 'seed': 297\n* });\n*\n* var v = gumbel( 2.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 2, 3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( N, K, n ) {\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\treturn new RangeError( format( 'invalid argument. Third argument must be less than or equal to the first argument. Value: `%u`.', n ) );\n\t}\n\tif ( K > N ) {\n\t\treturn new RangeError( format( 'invalid argument. Second argument must be less than or equal to the first argument. Value: `%u`.', K ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factorial = require( '@stdlib/math/base/special/factorial' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution using the HIN algorithm, which is based on an inverse transformation method.\n*\n* ## References\n*\n* - Fishman, George S. 1973. _Concepts and methods in discrete event digital simulation_. A Wiley-Interscience Publication. New York, NY, USA: Wiley.\n* - Kachitvichyanukul, Voratas., and Burce Schmeiser. 1985. \"Computer generation of hypergeometric random variates.\" _Journal of Statistical Computation and Simulation_ 22 (2): 127\u201345. doi:[10.1080/00949658508810839][@kachitvichyanukul:1985].\n*\n* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {NonNegativeInteger} n1 - number of successes in population\n* @param {NonNegativeInteger} n2 - number of failures in population\n* @param {NonNegativeInteger} k - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction hin( rand, n1, n2, k ) {\n\tvar p;\n\tvar u;\n\tvar x;\n\tif ( k < n2 ) {\n\t\tp = ( factorial( n2 ) * factorial( n1 + n2 - k ) ) /\n\t\t\t( factorial( n1 + n2 ) * factorial( n2 - k ) );\n\t\tx = 0;\n\t} else {\n\t\tp = ( factorial( n1 ) * factorial( k ) ) /\n\t\t\t( factorial( k - n2 ) * factorial( n1 + n2 ) );\n\t\tx = k - n2;\n\t}\n\tu = rand();\n\twhile ( u > p ) {\n\t\tu -= p;\n\t\tp *= ( n1 - x ) * ( k - x ) / ( ( x + 1 ) * ( n2 - k + 1 + x ) );\n\t\tx += 1;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hin = require( './hin.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution.\n*\n* ## References\n*\n* - Kachitvichyanukul, Voratas., and Burce Schmeiser. 1985. \"Computer generation of hypergeometric random variates.\" _Journal of Statistical Computation and Simulation_ 22 (2): 127\u201345. doi:[10.1080/00949658508810839][@kachitvichyanukul:1985].\n*\n* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction hypergeometric( rand, N, K, n ) {\n\tvar n1;\n\tvar n2;\n\tvar k;\n\tvar x;\n\n\tif ( n > N/2 ) {\n\t\tk = N - n;\n\t\tif ( 2*K <= N ) {\n\t\t\tn1 = K;\n\t\t\tn2 = N - K;\n\t\t\tx = hin( rand, n1, n2, k );\n\t\t\treturn K - x;\n\t\t}\n\t\tn2 = K;\n\t\tn1 = N - K;\n\t\tx = hin( rand, n1, n2, k );\n\t\treturn n - N + K + x;\n\t}\n\tk = n;\n\tif ( 2*K <= N ) {\n\t\tn1 = K;\n\t\tn2 = N - K;\n\t\tx = hin( rand, n1, n2, k );\n\t\treturn x;\n\t}\n\tn1 = N - K;\n\tn2 = K;\n\tx = hin( rand, n1, n2, k );\n\treturn n - x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar hypergeometric0 = require( './hypergeometric.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating hypergeometric distributed random numbers.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var hypergeometric = factory( 5, 3, 2 );\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var hypergeometric = factory( 10, 10, 10, {\n* 'seed': 297\n* });\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var hypergeometric = factory();\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar N;\n\tvar K;\n\tvar n;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tN = arguments[ 0 ];\n\t\tK = arguments[ 1 ];\n\t\tn = arguments[ 2 ];\n\t\terr = validate( N, K, n );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( N === void 0 ) {\n\t\tprng = hypergeometric2;\n\t} else {\n\t\tprng = hypergeometric1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'hypergeometric' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( N === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ N, K, n ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a hypergeometric distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = hypergeometric1();\n\t* // returns \n\t*/\n\tfunction hypergeometric1() {\n\t\treturn hypergeometric0( rand, N, K, n );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} N - population size\n\t* @param {NonNegativeInteger} K - subpopulation size\n\t* @param {NonNegativeInteger} n - number of draws\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = hypergeometric2( 5, 3, 2 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = hypergeometric2( NaN, NaN, NaN );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = hypergeometric2( 5.21, 3.14, 2.76 );\n\t* // returns NaN\n\t*/\n\tfunction hypergeometric2( N, K, n ) {\n\t\tif (\n\t\t\tN === PINF ||\n\t\t\tK === PINF ||\n\t\t\t!isNonNegativeInteger( N ) ||\n\t\t\t!isNonNegativeInteger( K ) ||\n\t\t\t!isNonNegativeInteger( n ) ||\n\t\t\tn > N\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn hypergeometric0( rand, N, K, n );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution.\n*\n* @name hypergeometric\n* @type {PRNG}\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*\n* @example\n* var v = hypergeometric( -5, 3, 2 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( 5, 3.14, 2 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( 5, 3, 1.5 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( NaN, NaN, NaN );\n* // returns NaN\n*/\nvar hypergeometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Hypergeometric distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/hypergeometric\n*\n* @example\n* var hypergeometric = require( '@stdlib/random/base/hypergeometric' );\n*\n* var v = hypergeometric( 10, 10, 10 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory( 5, 3, 2, {\n* 'seed': 297\n* });\n*\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory();\n*\n* var v = hypergeometric( 10, 2, 2 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory({\n* 'seed': 297\n* });\n*\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isPositive( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from Kumaraswamy's double bounded distribution.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator for uniformly distributed numbers\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( rand, a, b ) {\n\tvar u = rand();\n\treturn pow( 1.0 - pow( 1.0-u, 1.0/b ), 1.0/a );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar kumaraswamy0 = require( './kumaraswamy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Kumaraswamy's double bounded distributed random numbers.\n*\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var kumaraswamy = factory( 2.0, 1.0 );\n* var v = kumaraswamy();\n* // returns \n*\n* @example\n* var kumaraswamy = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = kumaraswamy();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = kumaraswamy2;\n\t} else {\n\t\tprng = kumaraswamy1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'kumaraswamy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a Kumaraswamy's double bounded distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta1();\n\t* // returns \n\t*/\n\tfunction kumaraswamy1() {\n\t\treturn kumaraswamy0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} a - first shape parameter\n\t* @param {PositiveNumber} b - second shape parameter\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = kumaraswamy2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction kumaraswamy2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta <= 0.0 ||\n\t\t\tb <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn kumaraswamy0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a Kumaraswamy's double bounded distributed random number.\n*\n* @name kumaraswamy\n* @type {PRNG}\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {Probability} pseudorandom number\n*\n* @example\n* var r = kumaraswamy( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = kumaraswamy( -2.0, 5.0 );\n* // returns NaN\n*/\nvar kumaraswamy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = kumaraswamy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Kumaraswamy's double bounded distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/kumaraswamy\n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/base/kumaraswamy' );\n*\n* var v = kumaraswamy( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/kumaraswamy' ).factory;\n*\n* var kumaraswamy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = kumaraswamy();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, b ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction laplace( rand, mu, b ) {\n\tvar u = rand() - 0.5;\n\treturn mu - ( b*sign( u )*ln( 1.0 - (2.0*abs(u)) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar laplace0 = require( './laplace.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Laplace (double exponential) distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var laplace = factory( 0.0, 1.0 );\n* var v = laplace();\n* // returns \n*\n* @example\n* var laplace = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = laplace();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( mu, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = laplace2;\n\t} else {\n\t\tprng = laplace1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'laplace' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = laplace1();\n\t* // returns \n\t*/\n\tfunction laplace1() {\n\t\treturn laplace0( rand, mu, b );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} b - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = laplace2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = laplace2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction laplace2( mu, b ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( b ) ||\n\t\t\tb <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn laplace0( rand, mu, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n*\n* @name laplace\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = laplace( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = laplace( 0.0, -1.0 );\n* // returns NaN\n*/\nvar laplace = factory();\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Laplace (double exponential) distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/laplace\n*\n* @example\n* var laplace = require( '@stdlib/random/base/laplace' );\n*\n* var v = laplace( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/laplace' ).factory;\n* var laplace = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = laplace();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/laplace' ).factory;\n* var laplace = factory({\n* 'seed': 297\n* });\n*\n* var v = laplace( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, c ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( c ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar normalQuantile = require( '@stdlib/stats/base/dists/normal/quantile' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction levy( rand, mu, c ) {\n\tvar z = normalQuantile( 1.0 - ( rand() / 2.0 ), 0.0, 1.0 );\n\treturn mu + ( c / ( z*z ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = levy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar levy0 = require( './levy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a L\u00E9vy distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var levy = factory( 0.0, 1.0 );\n* var v = levy();\n* // returns \n*\n* @example\n* var levy = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = levy();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar c;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tc = arguments[ 1 ];\n\t\terr = validate( mu, c );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = levy2;\n\t} else {\n\t\tprng = levy1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'levy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, c ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a L\u00E9vy distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = levy1();\n\t* // returns \n\t*/\n\tfunction levy1() {\n\t\treturn levy0( rand, mu, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} c - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = levy2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = levy2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction levy2( mu, c ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( c ) ||\n\t\t\tc <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn levy0( rand, mu, c );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n*\n* @name levy\n* @type {PRNG}\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = levy( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = levy( 0.0, -1.0 );\n* // returns NaN\n*/\nvar levy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = levy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* L\u00E9vy distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/levy\n*\n* @example\n* var levy = require( '@stdlib/random/base/levy' );\n*\n* var v = levy( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/levy' ).factory;\n* var levy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = levy();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/levy' ).factory;\n* var levy = factory({\n* 'seed': 297\n* });\n*\n* var v = levy( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, s ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a logistic distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction logistic( rand, mu, s ) {\n\tvar u = rand();\n\treturn mu + ( s*ln( u / (1.0-u) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar logistic0 = require( './logistic.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a logistic distribution.\n*\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var logistic = factory( 0.0, 1.0 );\n*\n* var v = logistic();\n* // returns \n*\n* @example\n* var logistic = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = logistic();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar s;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\terr = validate( mu, s );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = logistic2;\n\t} else {\n\t\tprng = logistic1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'logistic' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, s ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a logistic distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = logistic1();\n\t* // returns \n\t*/\n\tfunction logistic1() {\n\t\treturn logistic0( rand, mu, s );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = logistic2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = logistic2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction logistic2( mu, s ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( s ) ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn logistic0( rand, mu, s );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a logistic distribution.\n*\n* @name logistic\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = logistic( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = logistic( 0.0, -1.0 );\n* // returns NaN\n*/\nvar logistic = factory();\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Logistic distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/logistic\n*\n* @example\n* var logistic = require( '@stdlib/random/base/logistic' );\n*\n* var v = logistic( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/logistic' ).factory;\n* var logistic = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = logistic();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/logistic' ).factory;\n* var logistic = factory({\n* 'seed': 297\n* });\n*\n* var v = logistic( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar exp = require( '@stdlib/math/base/special/exp' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution.\n*\n* ## Notes\n*\n* - Appropriate for \\\\(lambda < 30\\\\).\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tvar p = rand();\n\tvar k = 1;\n\twhile ( p > exp( -lambda ) ) {\n\t\tk += 1;\n\t\tp *= rand();\n\t}\n\treturn k - 1;\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factorialln = require( '@stdlib/math/base/special/factorialln' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar LN_SQRT_TWO_PI = require( '@stdlib/constants/float64/ln-sqrt-two-pi' );\n\n\n// VARIABLES //\n\nvar ONE_12 = 1.0 / 12.0;\nvar ONE_360 = 1.0 / 360.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* ## References\n*\n* - H\u00F6rmann, W. 1993. \"The transformed rejection method for generating Poisson random variables.\" _Insurance: Mathematics and Economics_ 12 (1): 39\u201345. doi:[10.1016/0167-6687(93)90997-4][@hormann:1993b].\n*\n* [@hormann:1993b]: http://dx.doi.org/10.1016/0167-6687(93)90997-4\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tvar slambda;\n\tvar ainv;\n\tvar urvr;\n\tvar us;\n\tvar vr;\n\tvar a;\n\tvar b;\n\tvar k;\n\tvar u;\n\tvar v;\n\n\tslambda = sqrt( lambda );\n\n\tb = (2.53*slambda) + 0.931;\n\ta = (0.02483*b) - 0.059;\n\n\tainv = (1.1328/(b-3.4)) + 1.1239;\n\tvr = (-3.6224/(b-2.0)) + 0.9277;\n\turvr = 0.86 * vr;\n\n\twhile ( true ) {\n\t\tv = rand();\n\t\tif ( v <= urvr ) {\n\t\t\tu = (v / vr) - 0.43;\n\t\t\tu *= (2.0*a / (0.5-abs(u))) + b;\n\t\t\tu += lambda + 0.445;\n\t\t\treturn floor( u );\n\t\t}\n\t\tif ( v >= vr ) {\n\t\t\tu = rand() - 0.5;\n\t\t} else {\n\t\t\tu = (v / vr) - 0.93;\n\t\t\tu = (sign( u )*0.5) - u;\n\t\t\tv = vr * rand();\n\t\t}\n\t\tus = 0.5 - abs( u );\n\t\tif (\n\t\t\tus >= 0.013 ||\n\t\t\tus >= v\n\t\t) {\n\t\t\tk = floor( (((2.0*a/us) + b)*u) + lambda + 0.445 );\n\t\t\tv *= ainv / ( (a/(us*us)) + b );\n\t\t\tu = (k+0.5) * ln( lambda/k );\n\t\t\tu += -lambda - LN_SQRT_TWO_PI + k;\n\t\t\tu -= ( ONE_12 - (ONE_360/(k*k)) ) / k;\n\t\t\tif (\n\t\t\t\tk >= 10 &&\n\t\t\t\tu >= ln( v*slambda )\n\t\t\t) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tu = (k*ln( lambda )) - lambda - factorialln( k );\n\t\t\tif (\n\t\t\t\tk >= 0 &&\n\t\t\t\tk <= 9 &&\n\t\t\t\tu >= ln( v )\n\t\t\t) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar knuth = require( './knuth.js' );\nvar rejection = require( './rejection.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tif ( lambda < 30.0 ) {\n\t\treturn knuth( rand, lambda );\n\t}\n\treturn rejection( rand, lambda );\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar poisson0 = require( './poisson.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Poisson distributed random numbers.\n*\n* @param {PositiveNumber} [lambda] - mean\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var poisson = factory( 5.0 );\n* var v = poisson();\n* // returns \n*\n* @example\n* var poisson = factory( 8.0, {\n* 'seed': 297\n* });\n* var v = poisson();\n* // returns \n*\n* @example\n* var poisson = factory();\n* var v = poisson( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tlambda = arguments[ 0 ];\n\t\tif ( !isPositive( lambda ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = poisson2;\n\t} else {\n\t\tprng = poisson1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'poisson' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( lambda === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = poisson1();\n\t* // returns \n\t*/\n\tfunction poisson1() {\n\t\treturn poisson0( rand, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - mean\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = poisson2( 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = poisson2( NaN );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = poisson2( -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction poisson2( lambda ) {\n\t\tif (\n\t\t\tisnan( lambda ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn poisson0( rand, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* ## Method\n*\n* - When \\\\(\\lambda < 30\\\\), use Knuth's method.\n* - When \\\\(lambda \\geq 30\\\\), use transformed rejection method as Knuth's method does not scale well with \\\\(\\lambda\\\\).\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n* - H\u00F6rmann, W. 1993. \"The transformed rejection method for generating Poisson random variables.\" _Insurance: Mathematics and Economics_ 12 (1): 39\u201345. doi:[10.1016/0167-6687(93)90997-4][@hormann:1993b].\n*\n* [@hormann:1993b]: http://dx.doi.org/10.1016/0167-6687(93)90997-4\n*\n* @name poisson\n* @type {PRNG}\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = poisson( 0.5 );\n* // returns \n*\n* @example\n* var v = poisson( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = poisson( NaN );\n* // returns NaN\n*/\nvar poisson = factory();\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Poisson distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/poisson\n*\n* @example\n* var poisson = require( '@stdlib/random/base/poisson' );\n*\n* var v = poisson( 4.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/poisson' ).factory;\n* var poisson = factory( 4.0, {\n* 'seed': 297\n* });\n*\n* var v = poisson();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/poisson' ).factory;\n* var poisson = factory({\n* 'seed': 297\n* });\n*\n* var v = poisson( 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {number} p - success probability\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 10, 0.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( r, p ) {\n\tif ( !isPositive( r ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', r ) );\n\t}\n\tif ( !isNumber( p ) || isnan( p ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', p ) );\n\t}\n\tif ( p <= 0.0 || p >= 1.0 ) {\n\t\treturn new RangeError( format( 'invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.', p ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar poisson = require( './../../../base/poisson' ).factory;\nvar gamma = require( './../../../base/gamma' ).factory;\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating negative binomial distributed random numbers.\n*\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {number} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be number\n* @throws {RangeError} `p` must be a number on the interval `(0,1)`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var negativeBinomial = factory( 10, 0.5 );\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var negativeBinomial = factory( 10, 0.8, {\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var negativeBinomial = factory();\n*\n* var v = negativeBinomial( 10, 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar STATE;\n\tvar rpois;\n\tvar opts;\n\tvar prng;\n\tvar rand;\n\tvar FLG;\n\tvar err;\n\tvar p;\n\tvar r;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trpois = poisson( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trpois = poisson({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trpois = poisson( opts );\n\t\t}\n\t} else {\n\t\tr = arguments[ 0 ];\n\t\tp = arguments[ 1 ];\n\t\terr = validate( r, p );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trpois = poisson({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trpois = poisson( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trpois = poisson( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\tif ( r === void 0 ) {\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( r, p/(1-p), {\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rpois.state;\n\t\t\trpois.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\tif ( r === void 0 ) {\n\t\t\trgamma = gamma({\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( r, p/(1-p), {\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t}\n\t}\n\tif ( r === void 0 ) {\n\t\tprng = negativeBinomial2;\n\t} else {\n\t\tprng = negativeBinomial1;\n\t}\n\trand = rpois.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'negative-binomial' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( r === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ r, p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a negative binomial distribution with bound parameters `r` and `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = negativeBinomial1();\n\t* // returns \n\t*/\n\tfunction negativeBinomial1() {\n\t\treturn rpois( rgamma() );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a negative binomial distribution with parameters `r` and `p`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} r - number of successes until experiment is stopped\n\t* @param {number} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = negativeBinomial2( 10, 0.5 );\n\t* // returns \n\t*/\n\tfunction negativeBinomial2( r, p ) {\n\t\tif (\n\t\t\tisnan( r ) ||\n\t\t\tisnan( p ) ||\n\t\t\tp <= 0.0 ||\n\t\t\tp >= 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rpois( rgamma( r, p/(1-p) ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a negative binomial distribution.\n*\n* @name negativeBinomial\n* @type {PRNG}\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {number} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = negativeBinomial( 10, 0.5 );\n* // returns \n*/\nvar negativeBinomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = negativeBinomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Negative binomial distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/negative-binomial\n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/base/negative-binomial' );\n*\n* var v = negativeBinomial( 20, 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/negative-binomial' ).factory;\n* var negativeBinomial = factory( 10, 0.3, {\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/negative-binomial' ).factory;\n* var negativeBinomial = factory({\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial( 10, 0.67 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction pareto( rand, alpha, beta ) {\n\treturn beta / pow( rand(), 1.0/alpha );\n}\n\n\n// EXPORTS //\n\nmodule.exports = pareto;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar pareto0 = require( './pareto.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Pareto (Type I) distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var pareto1 = factory( 2.0, 1.0 );\n*\n* var v = pareto1();\n* // returns \n*\n* @example\n* var pareto1 = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = pareto1();\n* // returns \n*/\nfunction factory() {\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = pareto2;\n\t} else {\n\t\tprng = pareto1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'pareto-type1' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Pareto (Type I) distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = pareto1();\n\t* // returns \n\t*/\n\tfunction pareto1() {\n\t\treturn pareto0( rand, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = pareto2( 2.0, 3.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = pareto2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = pareto2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = pareto2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction pareto2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn pareto0( rand, alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n*\n* @name pareto1\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = pareto1( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var v = pareto1( -2.0, 3.0 );\n* // returns NaN\n*/\nvar pareto1 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = pareto1;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Pareto (Type I) distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/pareto-type1\n*\n* @example\n* var pareto1 = require( '@stdlib/random/base/pareto-type1' );\n*\n* var v = pareto1( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/pareto-type1' ).factory;\n* var pareto1 = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = pareto1();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/pareto-type1' ).factory;\n* var pareto1 = factory({\n* 'seed': 297\n* });\n*\n* var v = pareto1( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"name\": \"mt19937\",\n\t\"copy\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar minstd = require( './../../../base/minstd' );\nvar minstdShuffle = require( './../../../base/minstd-shuffle' );\nvar mt19937 = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'minstd' ] = minstd;\nprngs[ 'minstd-shuffle' ] = minstdShuffle;\nprngs[ 'mt19937' ] = mt19937;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers having integer values.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of pseudorandom number generator\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randi = factory();\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'name': 'minstd'\n* });\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'seed': 12345\n* });\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n* var v = randi();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( opts.seed === void 0 ) {\n\t\t\trand = prng.factory();\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'seed': opts.seed\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'state': opts.state,\n\t\t\t'copy': opts.copy\n\t\t});\n\t}\n\tsetReadOnly( randi, 'NAME', 'randi' );\n\tsetReadOnlyAccessor( randi, 'seed', getSeed );\n\tsetReadOnlyAccessor( randi, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( randi, 'state', getState, setState );\n\tsetReadOnlyAccessor( randi, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( randi, 'byteLength', getStateSize );\n\tsetReadOnly( randi, 'toJSON', toJSON );\n\tsetReadOnly( randi, 'PRNG', rand );\n\tsetReadOnly( randi, 'MIN', rand.MIN );\n\tsetReadOnly( randi, 'MAX', rand.MAX );\n\n\treturn randi;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = randi.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number having an integer value.\n\t*\n\t* @private\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = randi();\n\t* // returns \n\t*/\n\tfunction randi() {\n\t\treturn rand();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number having an integer value.\n*\n* @name randi\n* @type {PRNG}\n* @returns {integer} pseudorandom number\n*\n* @example\n* var v = randi();\n* // returns \n*/\nvar randi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/base/randi\n*\n* @example\n* var randi = require( '@stdlib/random/base/randi' );\n*\n* var v = randi();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randi' ).factory;\n*\n* var randi = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n*\n* var v = randi();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"name\": \"improved-ziggurat\",\n\t\"copy\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar boxMuller = require( './../../../base/box-muller' );\nvar improvedZiggurat = require( './../../../base/improved-ziggurat' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'box-muller' ] = boxMuller;\nprngs[ 'improved-ziggurat' ] = improvedZiggurat;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar format = require( '@stdlib/string/format' );\nvar noop = require( '@stdlib/utils/noop' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for numbers from a standard normal distribution.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='improved-ziggurat'] - name of pseudorandom number generator\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'name': 'box-muller'\n* });\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'seed': 12345\n* });\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'name': 'box-muller',\n* 'seed': 12345\n* });\n* var v = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\t\topts.prng = options.prng;\n\t\t\tif ( opts.prng === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.prng === void 0 ) {\n\t\tif ( opts.state === void 0 ) {\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\trand = prng.factory();\n\t\t\t} else {\n\t\t\t\trand = prng.factory({\n\t\t\t\t\t'seed': opts.seed\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'state': opts.state,\n\t\t\t\t'copy': opts.copy\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'prng': opts.prng\n\t\t});\n\t}\n\tsetReadOnly( normal, 'NAME', 'randn' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts.prng ) {\n\t\tsetReadOnly( normal, 'seed', null );\n\t\tsetReadOnly( normal, 'seedLength', null );\n\t\tsetReadWriteAccessor( normal, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( normal, 'stateLength', null );\n\t\tsetReadOnly( normal, 'byteLength', null );\n\t\tsetReadOnly( normal, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( normal, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( normal, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( normal, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( normal, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( normal, 'byteLength', getStateSize );\n\t\tsetReadOnly( normal, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( normal, 'PRNG', rand.PRNG );\n\treturn normal;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = normal.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a standard normal distribution.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal();\n\t* // returns \n\t*/\n\tfunction normal() {\n\t\treturn rand();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a standard normal random number.\n*\n* @name normal\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = normal();\n* // returns \n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Standard normal pseudorandom numbers.\n*\n* @module @stdlib/random/base/randn\n*\n* @example\n* var randn = require( '@stdlib/random/base/randn' );\n*\n* var v = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randn' ).factory;\n*\n* var randn = factory({\n* 'name': 'box-muller',\n* 'seed': 12345\n* });\n*\n* var v = randn();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number from a Rayleigh distribution with scale parameter `sigma`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction rayleigh( rand, sigma ) {\n\treturn sigma * sqrt( -2.0*ln( rand() ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar rayleigh0 = require( './rayleigh.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Rayleigh distributed random numbers.\n*\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var rayleigh = factory( 1.0 );\n*\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var rayleigh = factory( 0.5, {\n* 'seed': 297\n* });\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var rayleigh = factory();\n* var v = rayleigh( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tsigma = arguments[ 0 ];\n\t\tif ( !isPositive( sigma ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( sigma === void 0 ) {\n\t\tprng = rayleigh2;\n\t} else {\n\t\tprng = rayleigh1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'rayleigh' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( sigma === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a Rayleigh distribution with bound scale parameter `sigma`.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = rayleigh1();\n\t* // returns \n\t*/\n\tfunction rayleigh1() {\n\t\treturn rayleigh0( rand, sigma );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a Rayleigh distribution with scale parameter `sigma`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = rayleigh2( 3.0 );\n\t* // returns \n\t*/\n\tfunction rayleigh2( sigma ) {\n\t\tif (\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rayleigh0( rand, sigma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Rayleigh distribution with scale parameter `sigma`.\n*\n* @name rayleigh\n* @type {Function}\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = rayleigh( 3.0 );\n* // returns \n*\n* @example\n* var v = rayleigh( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = rayleigh( NaN );\n* // returns NaN\n*/\nvar rayleigh = factory();\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Rayleigh distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/rayleigh\n*\n* @example\n* var rayleigh = require( '@stdlib/random/base/rayleigh' );\n*\n* var v = rayleigh( 2.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/rayleigh' ).factory;\n* var rayleigh = factory( 3.0, {\n* 'seed': 297\n* });\n*\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/rayleigh' ).factory;\n* var rayleigh = factory({\n* 'seed': 297\n* });\n*\n* var v = rayleigh( 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating t-distributed random numbers.\n*\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var t = factory( 1.0 );\n*\n* var v = t();\n* // returns \n*\n* @example\n* var t = factory( 0.5, {\n* 'seed': 297\n* });\n* var v = t();\n* // returns \n*\n* @example\n* var t = factory();\n* var v = t( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar STATE;\n\tvar rnorm;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar FLG;\n\tvar v;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trnorm = randn( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\tif ( isObject( arguments[ 0 ] ) ) {\n\t\t\topts = arguments[ 0 ];\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\tv = arguments[ 0 ];\n\t\t\tif ( !isPositive( v ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number or an options object. Value: `%s`.', v ) );\n\t\t\t}\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tv = arguments[ 0 ];\n\t\tif ( !isPositive( v ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t\t}\n\t\topts = arguments[ 1 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trnorm = randn( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\tif ( v === void 0 ) {\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( v, {\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rnorm.state;\n\t\t\trnorm.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\tif ( v === void 0 ) {\n\t\t\trchisq = chisquare({\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( v, {\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t}\n\t}\n\tif ( v === void 0 ) {\n\t\tprng = t2;\n\t} else {\n\t\tprng = t1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 't' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( v === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ v ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Student's t-distribution with bound degrees of freedom `v`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = t1();\n\t* // returns \n\t*/\n\tfunction t1() {\n\t\treturn rnorm() / sqrt( rchisq() / v );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Student's t-distribution with degrees of freedom `v`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} v - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = t2( 3.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = t2( 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = t2( -1.5 );\n\t* // returns NaN\n\t*/\n\tfunction t2( v ) {\n\t\tif (\n\t\t\tisnan( v ) ||\n\t\t\tv <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rnorm() / sqrt( rchisq( v ) / v );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Student's t-distribution with degrees of freedom `v`.\n*\n* @name t\n* @type {PRNG}\n* @param {PositiveNumber} v - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = t( 3.0 );\n* // returns \n*\n* @example\n* var v = t( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = t( NaN );\n* // returns NaN\n*/\nvar t = factory();\n\n\n// EXPORTS //\n\nmodule.exports = t;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Student's t-distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/t\n*\n* @example\n* var t = require( '@stdlib/random/base/t' );\n*\n* var v = t( 2.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/t' ).factory;\n* var t = factory( 3.0, {\n* 'seed': 297\n* });\n*\n* var v = t();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/t' ).factory;\n* var t = factory({\n* 'seed': 297\n* });\n*\n* var v = t( 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0, 1.3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b, c ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\treturn new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b` and mode `c`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {number} pseudorandom number\n*/\nfunction triangular( rand, a, b, c ) {\n\tvar fc;\n\tvar x;\n\tvar u;\n\tfc = (c - a) / (b - a);\n\tu = rand();\n\tif ( u < fc ) {\n\t\tx = (b - a) * (c - a);\n\t\treturn a + sqrt( x * u );\n\t}\n\tx = (b - a) * (b - c);\n\treturn b - sqrt( x * (1.0 - u) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar triangular0 = require( './triangular.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers drawn from a triangular distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var triangular = factory( 0.0, 1.0, 0.8 );\n*\n* var v = triangular();\n* // returns \n*\n* @example\n* var triangular = factory( -3.0, -1.0, -2.0, {\n* 'seed': 297\n* });\n* var v = triangular();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\tvar c;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\tc = arguments[ 2 ];\n\t\terr = validate( a, b, c );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = triangular2;\n\t} else {\n\t\tprng = triangular1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'triangular' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b, c ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a triangular distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = triangular1();\n\t* // returns \n\t*/\n\tfunction triangular1() {\n\t\treturn triangular0( rand, a, b, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b`, and mode `c`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {number} c - mode\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = triangular2( 0.0, 1.0, 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = triangular2( 1.0, 0.0, 0.5 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = triangular2( 1.0, 2.0, NaN );\n\t* // returns NaN\n\t*/\n\tfunction triangular2( a, b, c ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\tisnan( c ) ||\n\t\t\t!(a <= c && c <= b)\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn triangular0( rand, a, b, c );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b`, and mode `c`.\n*\n* @name triangular\n* @type {PRNG}\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = triangular( 0.0, 1.0, 0.5 );\n* // returns \n*/\nvar triangular = factory();\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Triangular distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/triangular\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var v = triangular( 0.0, 10.0, 7.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/triangular' ).factory;\n* var triangular = factory( -5.0, 5.0, 3.0, {\n* 'seed': 297\n* });\n*\n* var v = triangular();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/triangular' ).factory;\n* var triangular = factory({\n* 'seed': 297\n* });\n*\n* var v = triangular( -5.0, 5.0, 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( k, lambda ) {\n\tif ( !isPositive( k ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Scale parameter must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositive( lambda ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Shape parameter must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Weibull distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction weibull( rand, k, lambda ) {\n\treturn lambda * pow( -ln( 1.0-rand() ), 1.0/k );\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar weibull0 = require( './weibull.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Weibull distributed random numbers.\n*\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var weibull = factory( 2.0, 1.0 );\n*\n* var v = weibull();\n* // returns \n*\n* @example\n* var weibull = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = weibull();\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar k;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tlambda = arguments[ 1 ];\n\t\terr = validate( lambda, k );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = weibull2;\n\t} else {\n\t\tprng = weibull1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'weibull' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k, lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = weibull1();\n\t* // returns \n\t*/\n\tfunction weibull1() {\n\t\treturn weibull0( rand, k, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - scale parameter\n\t* @param {PositiveNumber} lambda - shape parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = weibull2( 2.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = weibull2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = weibull2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = weibull2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction weibull2( k, lambda ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tisnan( lambda ) ||\n\t\t\tk <= 0.0 ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn weibull0( rand, k, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Weibull distribution.\n*\n* @name weibull\n* @type {PRNG}\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var v = weibull( -2.0, 3.0 );\n* // returns NaN\n*/\nvar weibull = factory();\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Weibull distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/weibull\n*\n* @example\n* var weibull = require( '@stdlib/random/base/weibull' );\n*\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/weibull' ).factory;\n* var weibull = factory( 2.0, 3.0, {\n* 'seed': 297\n* });\n*\n* var v = weibull();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/weibull' ).factory;\n* var weibull = factory({\n* 'seed': 297\n* });\n*\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n// This file is generated using `scripts/build.js`.\n\n'use strict';\n\n// MODULES //\n\nvar prng0 = require( './../../../base/arcsine' );\nvar prng1 = require( './../../../base/bernoulli' );\nvar prng2 = require( './../../../base/beta' );\nvar prng3 = require( './../../../base/betaprime' );\nvar prng4 = require( './../../../base/binomial' );\nvar prng5 = require( './../../../base/box-muller' );\nvar prng6 = require( './../../../base/cauchy' );\nvar prng7 = require( './../../../base/chi' );\nvar prng8 = require( './../../../base/chisquare' );\nvar prng9 = require( './../../../base/cosine' );\nvar prng10 = require( './../../../base/discrete-uniform' );\nvar prng11 = require( './../../../base/erlang' );\nvar prng12 = require( './../../../base/exponential' );\nvar prng13 = require( './../../../base/f' );\nvar prng14 = require( './../../../base/frechet' );\nvar prng15 = require( './../../../base/gamma' );\nvar prng16 = require( './../../../base/geometric' );\nvar prng17 = require( './../../../base/gumbel' );\nvar prng18 = require( './../../../base/hypergeometric' );\nvar prng19 = require( './../../../base/improved-ziggurat' );\nvar prng20 = require( './../../../base/invgamma' );\nvar prng21 = require( './../../../base/kumaraswamy' );\nvar prng22 = require( './../../../base/laplace' );\nvar prng23 = require( './../../../base/levy' );\nvar prng24 = require( './../../../base/logistic' );\nvar prng25 = require( './../../../base/lognormal' );\nvar prng26 = require( './../../../base/minstd' );\nvar prng27 = require( './../../../base/minstd-shuffle' );\nvar prng28 = require( './../../../base/mt19937' );\nvar prng29 = require( './../../../base/negative-binomial' );\nvar prng30 = require( './../../../base/normal' );\nvar prng31 = require( './../../../base/pareto-type1' );\nvar prng32 = require( './../../../base/poisson' );\nvar prng33 = require( './../../../base/randi' );\nvar prng34 = require( './../../../base/randn' );\nvar prng35 = require( './../../../base/randu' );\nvar prng36 = require( './../../../base/rayleigh' );\nvar prng37 = require( './../../../base/t' );\nvar prng38 = require( './../../../base/triangular' );\nvar prng39 = require( './../../../base/uniform' );\nvar prng40 = require( './../../../base/weibull' );\n\n\n// MAIN //\n\nvar prngs = {};\nprngs[ 'arcsine' ] = prng0.factory;\nprngs[ 'bernoulli' ] = prng1.factory;\nprngs[ 'beta' ] = prng2.factory;\nprngs[ 'betaprime' ] = prng3.factory;\nprngs[ 'binomial' ] = prng4.factory;\nprngs[ 'box-muller' ] = prng5.factory;\nprngs[ 'cauchy' ] = prng6.factory;\nprngs[ 'chi' ] = prng7.factory;\nprngs[ 'chisquare' ] = prng8.factory;\nprngs[ 'cosine' ] = prng9.factory;\nprngs[ 'discrete-uniform' ] = prng10.factory;\nprngs[ 'erlang' ] = prng11.factory;\nprngs[ 'exponential' ] = prng12.factory;\nprngs[ 'f' ] = prng13.factory;\nprngs[ 'frechet' ] = prng14.factory;\nprngs[ 'gamma' ] = prng15.factory;\nprngs[ 'geometric' ] = prng16.factory;\nprngs[ 'gumbel' ] = prng17.factory;\nprngs[ 'hypergeometric' ] = prng18.factory;\nprngs[ 'improved-ziggurat' ] = prng19.factory;\nprngs[ 'invgamma' ] = prng20.factory;\nprngs[ 'kumaraswamy' ] = prng21.factory;\nprngs[ 'laplace' ] = prng22.factory;\nprngs[ 'levy' ] = prng23.factory;\nprngs[ 'logistic' ] = prng24.factory;\nprngs[ 'lognormal' ] = prng25.factory;\nprngs[ 'minstd' ] = prng26.factory;\nprngs[ 'minstd-shuffle' ] = prng27.factory;\nprngs[ 'mt19937' ] = prng28.factory;\nprngs[ 'negative-binomial' ] = prng29.factory;\nprngs[ 'normal' ] = prng30.factory;\nprngs[ 'pareto-type1' ] = prng31.factory;\nprngs[ 'poisson' ] = prng32.factory;\nprngs[ 'randi' ] = prng33.factory;\nprngs[ 'randn' ] = prng34.factory;\nprngs[ 'randu' ] = prng35.factory;\nprngs[ 'rayleigh' ] = prng36.factory;\nprngs[ 't' ] = prng37.factory;\nprngs[ 'triangular' ] = prng38.factory;\nprngs[ 'uniform' ] = prng39.factory;\nprngs[ 'weibull' ] = prng40.factory;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar contains = require( '@stdlib/assert/contains' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar table = require( './prngs.js' );\n\n\n// VARIABLES //\n\nvar TYPED_ARRAY_CTORS = {\n\t'Int32Array': Int32Array,\n\t'Uint32Array': Uint32Array\n};\nvar PRNG_WRAPPERS = [ 'randi', 'randn', 'randu' ];\n\n\n// MAIN //\n\n/**\n* Revives a JSON-serialized pseudorandom number generator.\n*\n* @param {string} key - key\n* @param {*} value - value\n* @returns {(*|Function)} value or PRNG\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n*\n* var str = JSON.stringify( mt19937 );\n* var rand = parseJSON( str, reviveBasePRNG );\n* // returns \n*/\nfunction reviveBasePRNG( key, value ) {\n\tvar factory;\n\tvar opts;\n\tvar args;\n\tvar ctor;\n\tvar tmp;\n\tif (\n\t\tvalue &&\n\t\tvalue.type === 'PRNG' &&\n\t\tisString( value.name ) &&\n\t\tisObject( value.state ) &&\n\t\tisArray( value.params ) &&\n\t\tisString( value.state.type ) &&\n\t\tisArray( value.state.data )\n\t) {\n\t\topts = {};\n\t\tfactory = table[ value.name ];\n\t\tif ( factory === void 0 ) {\n\t\t\ttmp = value.name.split( '-' );\n\t\t\tif ( contains( PRNG_WRAPPERS, tmp[ 0 ] ) ) {\n\t\t\t\tfactory = table[ tmp[ 0 ] ];\n\t\t\t\topts.name = tmp.slice( 1 ).join( '-' );\n\t\t\t}\n\t\t}\n\t\tif ( factory ) {\n\t\t\tctor = TYPED_ARRAY_CTORS[ value.state.type ];\n\t\t\tif ( ctor ) {\n\t\t\t\topts.state = new ctor( value.state.data );\n\n\t\t\t\targs = value.params.slice();\n\t\t\t\targs.push( opts );\n\n\t\t\t\ttry {\n\t\t\t\t\treturn factory.apply( null, args );\n\t\t\t\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\t\t\t\t// Return the original JSON value...\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reviveBasePRNG;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Revive a JSON-serialized pseudorandom generator.\n*\n* @module @stdlib/random/base/reviver\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n* var reviveBasePRNG = require( '@stdlib/random/base/reviver' );\n*\n* var str = JSON.stringify( mt19937 );\n* var rand = parseJSON( str, reviveBasePRNG );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace random\n*/\nvar random = {};\n\n/**\n* @name arcsine\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/arcsine}\n*/\nsetReadOnly( random, 'arcsine', require( './../../base/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/bernoulli}\n*/\nsetReadOnly( random, 'bernoulli', require( './../../base/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/beta}\n*/\nsetReadOnly( random, 'beta', require( './../../base/beta' ) );\n\n/**\n* @name betaprime\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/betaprime}\n*/\nsetReadOnly( random, 'betaprime', require( './../../base/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/binomial}\n*/\nsetReadOnly( random, 'binomial', require( './../../base/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/box-muller}\n*/\nsetReadOnly( random, 'boxMuller', require( './../../base/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/cauchy}\n*/\nsetReadOnly( random, 'cauchy', require( './../../base/cauchy' ) );\n\n/**\n* @name chi\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/chi}\n*/\nsetReadOnly( random, 'chi', require( './../../base/chi' ) );\n\n/**\n* @name chisquare\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/chisquare}\n*/\nsetReadOnly( random, 'chisquare', require( './../../base/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/cosine}\n*/\nsetReadOnly( random, 'cosine', require( './../../base/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/discrete-uniform}\n*/\nsetReadOnly( random, 'discreteUniform', require( './../../base/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/erlang}\n*/\nsetReadOnly( random, 'erlang', require( './../../base/erlang' ) );\n\n/**\n* @name exponential\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/exponential}\n*/\nsetReadOnly( random, 'exponential', require( './../../base/exponential' ) );\n\n/**\n* @name f\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/f}\n*/\nsetReadOnly( random, 'f', require( './../../base/f' ) );\n\n/**\n* @name frechet\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/frechet}\n*/\nsetReadOnly( random, 'frechet', require( './../../base/frechet' ) );\n\n/**\n* @name gamma\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/gamma}\n*/\nsetReadOnly( random, 'gamma', require( './../../base/gamma' ) );\n\n/**\n* @name geometric\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/geometric}\n*/\nsetReadOnly( random, 'geometric', require( './../../base/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/gumbel}\n*/\nsetReadOnly( random, 'gumbel', require( './../../base/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/hypergeometric}\n*/\n\nsetReadOnly( random, 'hypergeometric', require( './../../base/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/improved-ziggurat}\n*/\nsetReadOnly( random, 'improvedZiggurat', require( './../../base/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/invgamma}\n*/\nsetReadOnly( random, 'invgamma', require( './../../base/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/kumaraswamy}\n*/\nsetReadOnly( random, 'kumaraswamy', require( './../../base/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/laplace}\n*/\nsetReadOnly( random, 'laplace', require( './../../base/laplace' ) );\n\n/**\n* @name levy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/levy}\n*/\nsetReadOnly( random, 'levy', require( './../../base/levy' ) );\n\n/**\n* @name logistic\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/logistic}\n*/\nsetReadOnly( random, 'logistic', require( './../../base/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/lognormal}\n*/\nsetReadOnly( random, 'lognormal', require( './../../base/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/minstd}\n*/\nsetReadOnly( random, 'minstd', require( './../../base/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/minstd-shuffle}\n*/\nsetReadOnly( random, 'minstdShuffle', require( './../../base/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/mt19937}\n*/\nsetReadOnly( random, 'mt19937', require( './../../base/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/negative-binomial}\n*/\nsetReadOnly( random, 'negativeBinomial', require( './../../base/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/normal}\n*/\nsetReadOnly( random, 'normal', require( './../../base/normal' ) );\n\n/**\n* @name pareto1\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/pareto-type1}\n*/\nsetReadOnly( random, 'pareto1', require( './../../base/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/poisson}\n*/\nsetReadOnly( random, 'poisson', require( './../../base/poisson' ) );\n\n/**\n* @name randi\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randi}\n*/\nsetReadOnly( random, 'randi', require( './../../base/randi' ) );\n\n/**\n* @name randn\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randn}\n*/\nsetReadOnly( random, 'randn', require( './../../base/randn' ) );\n\n/**\n* @name randu\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randu}\n*/\nsetReadOnly( random, 'randu', require( './../../base/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/rayleigh}\n*/\nsetReadOnly( random, 'rayleigh', require( './../../base/rayleigh' ) );\n\n/**\n* @name reviveBasePRNG\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/reviver}\n*/\nsetReadOnly( random, 'reviveBasePRNG', require( './../../base/reviver' ) );\n\n/**\n* @name t\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/t}\n*/\nsetReadOnly( random, 't', require( './../../base/t' ) );\n\n/**\n* @name triangular\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/triangular}\n*/\nsetReadOnly( random, 'triangular', require( './../../base/triangular' ) );\n\n/**\n* @name uniform\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/uniform}\n*/\nsetReadOnly( random, 'uniform', require( './../../base/uniform' ) );\n\n/**\n* @name weibull\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/weibull}\n*/\nsetReadOnly( random, 'weibull', require( './../../base/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rarcsine = require( './../../../base/arcsine' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rarcsine( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rarcsine( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/iter/arcsine\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/arcsine' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbern = require( './../../../base/bernoulli' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbern( p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbern( p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/iter/bernoulli\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/bernoulli' );\n*\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbeta = require( './../../../base/beta' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbeta( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbeta( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/iter/beta\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/beta' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbetaprime = require( './../../../base/betaprime' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbetaprime( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbetaprime( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/iter/betaprime\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/betaprime' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbinom = require( './../../../base/binomial' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive integer\n* @throws {TypeError} second argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 8, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( n, p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbinom( n, p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbinom( n, p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( n, p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/iter/binomial\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/binomial' );\n*\n* var iter = iterator( 10, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/box-muller' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @module @stdlib/random/iter/box-muller\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/box-muller' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rcauchy = require( './../../../base/cauchy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( x0, gamma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositive( gamma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rcauchy( x0, gamma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rcauchy( x0, gamma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( x0, gamma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/iter/cauchy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/cauchy' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rchi = require( './../../../base/chi' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rchi( k, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rchi( k );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/iter/chi\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/chi' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rchisq = require( './../../../base/chisquare' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rchisq( k, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rchisq( k );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/iter/chisquare\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/chisquare' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rcosine = require( './../../../base/cosine' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, s, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rcosine( mu, s, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rcosine( mu, s );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/iter/cosine\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/cosine' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isInteger = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar runif = require( './../../../base/discrete-uniform' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2, 6 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isInteger( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d,%d]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = runif( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = runif( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/iter/discrete-uniform\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/discrete-uniform' );\n*\n* var iter = iterator( -1, 2 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rerlang = require( './../../../base/erlang' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveInteger( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rerlang( k, lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rerlang( k, lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/iter/erlang\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/erlang' );\n*\n* var iter = iterator( 2, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rexp = require( './../../../base/exponential' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rexp( lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rexp( lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/iter/exponential\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/exponential' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rf = require( './../../../base/f' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( d1, d2, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( d1 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositiveNumber( d2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rf( d1, d2, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rf( d1, d2 );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( d1, d2, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/iter/f\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/f' );\n*\n* var iter = iterator( 2.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rfrechet = require( './../../../base/frechet' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - rate parameter\n* @param {number} m - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, s, m, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number. Value: `%s`.', m ) );\n\t}\n\tif ( arguments.length > 3 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rfrechet( alpha, s, m, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rfrechet( alpha, s, m );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, s, m, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/iter/frechet\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/frechet' );\n*\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgamma = require( './../../../base/gamma' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgamma( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgamma( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/iter/gamma\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/gamma' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgeom = require( './../../../base/geometric' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgeom( p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgeom( p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/iter/geometric\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/geometric' );\n*\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgumbel = require( './../../../base/gumbel' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a number\n* @throws {TypeError} second argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgumbel( mu, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgumbel( mu, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/iter/gumbel\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/gumbel' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rhypergeom = require( './../../../base/hypergeometric' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} third argument must be a nonnegative integer\n* @throws {RangeError} number of draws must be less than or equal to the population size\n* @throws {RangeError} subpopulation size must be less than or equal to the population size\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 10, 5, 3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( N, K, n, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.', n ) );\n\t}\n\tif ( K > N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.', K ) );\n\t}\n\tif ( arguments.length > 3 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rhypergeom( N, K, n, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rhypergeom( N, K, n );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( N, K, n, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/iter/hypergeometric\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/hypergeometric' );\n*\n* var iter = iterator( 10, 5, 6 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/improved-ziggurat' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @module @stdlib/random/iter/improved-ziggurat\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/improved-ziggurat' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rinvgamma = require( './../../../base/invgamma' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rinvgamma( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rinvgamma( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/iter/invgamma\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/invgamma' );\n*\n* var iter = iterator( 2.0, 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rkumaraswamy = require( './../../../base/kumaraswamy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rkumaraswamy( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rkumaraswamy( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/iter/kumaraswamy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/kumaraswamy' );\n*\n* var iter = iterator( 2.0, 1.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlaplace = require( './../../../base/laplace' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlaplace( mu, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlaplace( mu, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/iter/laplace\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/laplace' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlevy = require( './../../../base/levy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, c, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlevy( mu, c, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlevy( mu, c );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, c, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/iter/levy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/levy' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlogis = require( './../../../base/logistic' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, s, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlogis( mu, s, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlogis( mu, s );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/iter/logistic\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/logistic' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlognorm = require( './../../../base/lognormal' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlognorm( mu, sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlognorm( mu, sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/iter/lognormal\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/lognormal' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar minstd = require( './../../../base/minstd' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = minstd( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = minstd();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/iter/minstd\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/minstd' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar minstd = require( './../../../base/minstd-shuffle' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = minstd( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = minstd();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/iter/minstd-shuffle\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/minstd-shuffle' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = mt19937( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = mt19937();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/iter/mt19937\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/mt19937' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnbinom = require( './../../../base/negative-binomial' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} second argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 8, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( r, p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( r ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', r ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnbinom( r, p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnbinom( r, p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( r, p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/iter/negative-binomial\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/negative-binomial' );\n*\n* var iter = iterator( 10, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/normal' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( mu, sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm( mu, sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/iter/normal\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/normal' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rpareto = require( './../../../base/pareto-type1' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rpareto( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rpareto( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/iter/pareto-type1\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/pareto-type1' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rpois = require( './../../../base/poisson' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rpois( lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rpois( lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/iter/poisson\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/poisson' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randi = require( './../../../base/randi' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randi( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randi();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/iter/randi\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randi' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randn = require( './../../../base/randn' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randn( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randn();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @module @stdlib/random/iter/randn\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randn' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randu = require( './../../../base/randu' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating uniformly distributed pseudorandom numbers between 0 and 1.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randu( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randu();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating uniformly distributed pseudorandom numbers between 0 and 1.\n*\n* @module @stdlib/random/iter/randu\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randu' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rrayleigh = require( './../../../base/rayleigh' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rrayleigh( sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rrayleigh( sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( sigma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/iter/rayleigh\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/rayleigh' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rt = require( './../../../base/t' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( v, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( v ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rt( v, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rt( v );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( v, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @module @stdlib/random/iter/t\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/t' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rtriangular = require( './../../../base/triangular' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, c, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\tthrow new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\tif ( arguments.length > 3 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rtriangular( a, b, c, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rtriangular( a, b, c );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, c, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/iter/triangular\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/triangular' );\n*\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar runif = require( './../../../base/uniform' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = runif( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = runif( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/iter/uniform\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/uniform' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rweibull = require( './../../../base/weibull' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rweibull( k, lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rweibull( k, lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/iter/weibull\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/weibull' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../iter/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../iter/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../iter/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../iter/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../iter/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/box-muller}\n*/\nsetReadOnly( ns, 'boxMuller', require( './../../iter/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../iter/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../iter/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../iter/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../iter/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../iter/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../iter/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../iter/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/f}\n*/\nsetReadOnly( ns, 'f', require( './../../iter/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../iter/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../iter/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../iter/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../iter/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../iter/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/improved-ziggurat}\n*/\nsetReadOnly( ns, 'improvedZiggurat', require( './../../iter/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../iter/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../iter/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../iter/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../iter/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../iter/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../iter/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../iter/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../iter/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../iter/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../iter/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../iter/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../iter/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../iter/poisson' ) );\n\n/**\n* @name randi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randi}\n*/\nsetReadOnly( ns, 'randi', require( './../../iter/randi' ) );\n\n/**\n* @name randn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randn}\n*/\nsetReadOnly( ns, 'randn', require( './../../iter/randn' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../iter/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../iter/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/t}\n*/\nsetReadOnly( ns, 't', require( './../../iter/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../iter/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../iter/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../iter/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Samples from a discrete uniform distribution (equal probabilities and with replacement).\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @returns {Array} sample\n*/\nfunction discreteUniform( x, size, rand ) {\n\tvar pos;\n\tvar out;\n\tvar N;\n\tvar i;\n\n\tN = x.length;\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tpos = floor( N * rand() );\n\t\tout[ i ] = x[ pos ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Samples without replacement from a discrete set using custom probabilities.\n*\n* ## Notes\n*\n* - After each draw, the probabilities of the remaining observations are renormalized so that they sum to one.\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @param {ProbabilityArray} probabilities - element probabilities\n* @returns {Array} sample\n*/\nfunction renormalizing( x, size, rand, probabilities ) {\n\tvar probs;\n\tvar psum;\n\tvar out;\n\tvar N;\n\tvar i;\n\tvar j;\n\tvar k;\n\tvar u;\n\n\tN = x.length;\n\tprobs = new Array( N );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tprobs[ i ] = probabilities[ i ];\n\t}\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tu = rand();\n\t\tpsum = 0;\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tpsum += probs[ j ];\n\t\t\tif ( u < psum ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor ( k = 0; k < N; k++ ) {\n\t\t\tif ( k === j ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprobs[ k ] /= 1.0 - probs[ j ];\n\t\t}\n\t\tprobs[ j ] = 0.0;\n\t\tout[ i ] = x[ j ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = renormalizing;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// FUNCTIONS //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Samples uniformly without replacement using the Fisher-Yates shuffle.\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @returns {Array} sample\n*/\nfunction fisherYates( x, size, rand ) {\n\tvar tmp;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tN = x.length;\n\n\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\tfor ( i = N-1; i > 0; i-- ) {\n\t\t// Generate an integer index on the interval: [0,i]\n\t\tj = floor( rand()*(i+1) );\n\n\t\t// Swap elements:\n\t\ttmp = x[ i ];\n\t\tx[ i ] = x[ j ];\n\t\tx[ j ] = tmp;\n\t}\n\treturn slice.call( x, 0, size );\n}\n\n\n// EXPORTS //\n\nmodule.exports = fisherYates;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Samples with replacement and non-uniform probabilities using Vose's [alias method][alias-method].\n*\n* ## References\n*\n* - Vose, Michael D. 1991. \"A linear algorithm for generating random numbers with a given distribution.\" _IEEE Transactions on Software Engineering_ 17 (9): 972\u201375. doi:[10.1109/32.92917][@vose:1991].\n*\n* [alias-method]: http://keithschwarz.com/darts-dice-coins/\n* [@vose:1991]: https://doi.org/10.1109/32.92917\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @param {ProbabilityArray} probabilities - element probabilities\n* @returns {Array} sample\n*/\nfunction vose( x, size, rand, probabilities ) {\n\tvar small;\n\tvar large;\n\tvar probs;\n\tvar alias;\n\tvar out;\n\tvar N;\n\tvar p;\n\tvar g;\n\tvar i;\n\tvar l;\n\n\tprobs = probabilities.slice();\n\tN = x.length;\n\n\tsmall = [];\n\tlarge = [];\n\tfor ( i = 0; i < N; i++ ) {\n\t\tprobs[ i ] *= N;\n\t\tif ( probs[ i ] < 1.0 ) {\n\t\t\tsmall.push( i );\n\t\t} else {\n\t\t\tlarge.push( i );\n\t\t}\n\t}\n\talias = new Array( N );\n\tp = new Array( N );\n\twhile ( small.length !== 0 && large.length !== 0 ) {\n\t\tl = small.shift();\n\t\tg = large.shift();\n\t\tp[ l ] = probs[ l ];\n\t\talias[ l ] = g;\n\t\tprobs[ g ] = probs[ g ] + probs[ l ] - 1.0;\n\t\tif ( probs[ g ] < 1.0 ) {\n\t\t\tsmall.push( g );\n\t\t} else {\n\t\t\tlarge.push( g );\n\t\t}\n\t}\n\tfor ( i = 0; i < large.length; i++ ) {\n\t\tp[ large[ i ] ] = 1.0;\n\t}\n\tfor ( i = 0; i < small.length; i++ ) {\n\t\tp[ small[ i ] ] = 1.0;\n\t}\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tl = floor( N*rand() );\n\t\tif ( rand() < p[ l ] ) {\n\t\t\tout[ i ] = x[ l ];\n\t\t} else {\n\t\t\tout[ i ] = x[ alias[ l ] ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = vose;\n", "{\n\t\"mutate\": false,\n\t\"replace\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );\nvar isUnityProbabilityArray = require( '@stdlib/assert/is-unity-probability-array' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {ProbabilityArray} [options.probs] - element probabilities\n* @param {boolean} [options.replace] - boolean indicating whether to sample with replacement\n* @param {boolean} [options.mutate] - boolean indicating whether to mutate the `pool` when sampling without replacement\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'size': 10,\n* 'replace': false,\n* 'mutate': true,\n* 'probs': [ 0.7, 0.3 ]\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'size' ) ) {\n\t\topts.size = options.size;\n\t\tif ( !isNonNegativeInteger( opts.size ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'size', opts.size ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'probs' ) ) {\n\t\topts.probs = options.probs;\n\t\tif ( !isUnityProbabilityArray( opts.probs ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be an array of probabilities that sum to one. Option: `%s`.', 'probs', opts.probs ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'mutate' ) ) {\n\t\topts.mutate = options.mutate;\n\t\tif ( !isBoolean( opts.mutate ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'mutate', opts.mutate ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'replace' ) ) {\n\t\topts.replace = options.replace;\n\t\tif ( !isBoolean( opts.replace ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'replace', opts.replace ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert/is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar randu = require( './../../base/mt19937' ).factory;\nvar copy = require( '@stdlib/utils/copy' );\nvar discreteUniform = require( './discrete_uniform.js' );\nvar renormalizing = require( './renormalizing.js' );\nvar fisherYates = require( './fisher_yates.js' );\nvar vose = require( './vose.js' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// FUNCTIONS //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns a function to sample elements from an array-like object.\n*\n* @param {(ArrayLike|TypedArrayLike)} [pool] - array-like object from which to sample\n* @param {Options} [options] - function options\n* @param {PositiveInteger} [options.seed] - integer-valued seed\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement\n* @throws {TypeError} `pool` must be an array-like object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} function to sample elements from an array-like object\n*\n* @example\n* var sample = factory({\n* 'seed': 232\n* });\n* var out = sample( 'abcdefg' );\n* // e.g., returns [ 'g', 'd', 'g', 'f', 'c', 'e', 'f' ]\n*\n* @example\n* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {\n* 'seed': 232,\n* 'size': 2\n* });\n* var out = sample();\n* // e.g., returns [ 6, 4 ]\n*\n* out = sample();\n* // e.g., returns [ 6, 5 ]\n*\n* @example\n* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {\n* 'seed': 474,\n* 'size': 3,\n* 'mutate': true,\n* 'replace': false\n* });\n* var out = sample();\n* // e.g., returns [ 4, 3, 6 ]\n*\n* out = sample();\n* // e.g., returns [ 1, 5, 2 ]\n*\n* out = sample();\n* // returns null\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'size': 10\n* });\n* // e.g., returns [ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1 ]\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'replace': false\n* });\n* // e.g., returns [ 0, 1 ] or [ 1, 0 ]\n*\n* out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2,\n* 'mutate': true\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'replace': false\n* });\n* // e.g., returns [ 0, 1 ] or [ 1, 0 ]\n*\n* out = sample();\n* // returns null\n*/\nfunction factory() {\n\tvar config;\n\tvar pool;\n\tvar conf;\n\tvar rand;\n\tvar err;\n\tvar fcn;\n\n\tconf = copy( defaults );\n\tif ( arguments.length === 1 ) {\n\t\tif ( isArrayLike( arguments[ 0 ] ) || isTypedArrayLike( arguments[ 0 ] ) ) { // eslint-disable-line max-len\n\t\t\tpool = arguments[ 0 ];\n\t\t} else {\n\t\t\tconfig = arguments[ 0 ];\n\t\t\terr = validate( conf, config );\n\t\t}\n\t} else if ( arguments.length > 1 ) {\n\t\tpool = arguments[ 0 ];\n\t\tconfig = arguments[ 1 ];\n\t\tif ( !( isArrayLike( pool ) || isTypedArrayLike( pool ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. `%s` argument must be array-like. Value: `%s`.', 'pool', pool ) );\n\t\t}\n\t\terr = validate( conf, config );\n\t}\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( config && config.seed ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tif ( pool === void 0 ) {\n\t\tfcn = sample1;\n\t} else {\n\t\tif ( isString( pool ) ) {\n\t\t\tpool = pool.split( '' );\n\t\t} else {\n\t\t\tpool = copy( pool );\n\t\t}\n\t\tfcn = sample2;\n\t}\n\tsetReadOnly( fcn, 'seed', rand.seed );\n\tsetReadOnly( fcn, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn fcn;\n\n\t/**\n\t* Samples elements from an array-like object.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} x - array-like object from which to sample elements\n\t* @param {Options} [options] - function options\n\t* @param {NonNegativeInteger} [options.size] - sample size\n\t* @param {ProbabilityArray} [options.probs] - element probabilities\n\t* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`\n\t* @returns {Array} sample\n\t*/\n\tfunction sample1( x, options ) {\n\t\tvar replace;\n\t\tvar xcopy;\n\t\tvar probs;\n\t\tvar opts;\n\t\tvar size;\n\t\tvar err;\n\n\t\tif ( !( isArrayLike( x ) || isTypedArrayLike( x ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', x ) );\n\t\t}\n\t\tif ( isString( x ) ) {\n\t\t\tx = x.split( '' );\n\t\t}\n\t\topts = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tif ( opts.replace === void 0 ) {\n\t\t\treplace = conf.replace;\n\t\t} else {\n\t\t\treplace = opts.replace;\n\t\t}\n\t\tif ( opts.probs !== void 0 ) {\n\t\t\tprobs = opts.probs;\n\t\t}\n\t\tif ( opts.size ) {\n\t\t\tsize = opts.size;\n\t\t} else if ( conf.size ) {\n\t\t\tsize = conf.size;\n\t\t} else {\n\t\t\tsize = x.length;\n\t\t}\n\t\tif (\n\t\t\treplace === false &&\n\t\t\tsize > x.length\n\t\t) {\n\t\t\tthrow new RangeError( format( 'invalid option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `%s`.', size ) );\n\t\t}\n\t\t// Custom probabilities...\n\t\tif ( probs ) {\n\t\t\tif ( replace ) {\n\t\t\t\treturn vose( x, size, rand, probs );\n\t\t\t}\n\t\t\treturn renormalizing( x, size, rand, probs );\n\t\t}\n\t\t// All elements equally likely...\n\t\tif ( replace ) {\n\t\t\treturn discreteUniform( x, size, rand );\n\t\t}\n\t\txcopy = slice.call( x );\n\t\treturn fisherYates( xcopy, size, rand );\n\t}\n\n\t/**\n\t* Samples elements from a population.\n\t*\n\t* @private\n\t* @param {Options} [options] - function options\n\t* @param {NonNegativeInteger} [options.size] - sample size\n\t* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n\t* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {RangeError} `size` option must be less than or equal to the population when the `replace` option is `false`\n\t* @returns {Array} sample\n\t*/\n\tfunction sample2( options ) {\n\t\tvar replace;\n\t\tvar mutate;\n\t\tvar opts;\n\t\tvar size;\n\t\tvar err;\n\t\tvar out;\n\n\t\tif ( pool.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\t\topts = {};\n\t\tif ( arguments.length ) {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tif ( opts.mutate === void 0 ) {\n\t\t\tmutate = conf.mutate;\n\t\t} else {\n\t\t\tmutate = opts.mutate;\n\t\t}\n\t\tif ( opts.replace === void 0 ) {\n\t\t\treplace = conf.replace;\n\t\t} else {\n\t\t\treplace = opts.replace;\n\t\t}\n\t\tif ( opts.size ) {\n\t\t\tsize = opts.size;\n\t\t} else if ( conf.size ) {\n\t\t\tsize = conf.size;\n\t\t} else {\n\t\t\tsize = pool.length;\n\t\t}\n\t\tif (\n\t\t\treplace === false &&\n\t\t\tsize > pool.length\n\t\t) {\n\t\t\tthrow new RangeError( format( 'invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.', size ) );\n\t\t}\n\t\tif ( replace ) {\n\t\t\treturn discreteUniform( pool, size, rand );\n\t\t}\n\t\tout = fisherYates( pool, size, rand );\n\t\tif ( mutate ) {\n\t\t\t// Remove the sample observations:\n\t\t\tpool = pool.slice( size, pool.length );\n\t\t}\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Samples elements from an array-like object.\n*\n* @name sample\n* @type {Function}\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {Options} [options] - function options\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {ProbabilityArray} [options.probs] - element probabilities\n* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n* @throws {TypeError} first argument must be array-like\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`\n* @returns {Array} sample\n*\n* @example\n* var out = sample( [ 3, null, NaN, 'abc', function(){} ] );\n* // e.g., returns [ 3, 'abc', null, 3, null ]\n*/\nvar sample = factory();\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sample elements from an array-like object.\n*\n* @module @stdlib/random/sample\n*\n* @example\n* var sample = require( '@stdlib/random/sample' );\n*\n* var out = sample( 'abc' );\n* // e.g., returns [ 'a', 'a', 'b' ]\n*\n* out = sample( [ 3, 6, 9 ] );\n* // e.g., returns [ 3, 9, 6 ]\n*\n* var bool = ( out.length === 3 );\n* // returns true\n*\n* @example\n* var sample = require( '@stdlib/random/sample' );\n*\n* var mysample = sample.factory({\n* 'seed': 323\n* });\n* var out = mysample( [ 3, 6, 9 ], {\n* 'size': 10\n* });\n* // e.g., returns [ 3, 9, 3, 3, 3, 6, 3, 3, 3, 6 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"copy\": \"shallow\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar indexOf = require( '@stdlib/utils/index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar COPY_OPTIONS = [ 'deep', 'shallow', 'none' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {string} [options.copy] - string denoting whether to return a copy (`deep`, `shallow` or `none`)\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'copy': 'shallow'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isString( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( indexOf( COPY_OPTIONS, opts.copy ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'copy', COPY_OPTIONS.join( '\", \"' ), opts.copy ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert/is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar deepCopy = require( '@stdlib/utils/copy' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar randu = require( './../../base/mt19937' ).factory;\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to create a random permutation of elements from an array-like object.\n*\n* @param {Options} [config] - function options\n* @param {PositiveInteger} [config.seed] - integer-valued seed\n* @param {string} [config.copy=\"shallow\"] - default copy option (`deep`, `shallow` or `none`)\n* @throws {TypeError} options argument must be an object\n* @returns {Function} shuffle function\n*\n* @example\n* var shuffle = factory({\n* 'seed': 249\n* });\n* var data = [ 3, 8, 4, 8 ];\n* var out = shuffle( data );\n* // e.g., returns [ 4, 3, 8, 8 ]\n*/\nfunction factory( config ) {\n\tvar conf;\n\tvar rand;\n\tvar err;\n\n\tconf = deepCopy( defaults );\n\tif ( arguments.length ) {\n\t\terr = validate( conf, config );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( config && config.seed ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tsetReadOnly( shuffle, 'seed', rand.seed );\n\tsetReadOnly( shuffle, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn shuffle;\n\n\t/**\n\t* Returns a random permutation of elements in `arr`.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} arr - array-like object to shuffle\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.copy] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {ArrayLike} the shuffled array-like object\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data );\n\t* // e.g., returns [ 3, 1, 2 ]\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data, {\n\t* 'copy': 'none'\n\t* });\n\t* var bool = ( data === out );\n\t* // returns true\n\t*/\n\tfunction shuffle( arr, options ) {\n\t\tvar strflg;\n\t\tvar level;\n\t\tvar copy;\n\t\tvar opts;\n\t\tvar err;\n\t\tvar out;\n\t\tvar tmp;\n\t\tvar N;\n\t\tvar i;\n\t\tvar j;\n\n\t\tif ( !( isArrayLike( arr ) || isTypedArrayLike( arr ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', arr ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = {};\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tcopy = ( opts && opts.copy ) ? opts.copy : conf.copy;\n\n\t\tstrflg = isString( arr );\n\t\tif ( strflg ) {\n\t\t\tarr = arr.split( '' );\n\t\t\tcopy = 'none';\n\t\t}\n\n\t\tlevel = 0;\n\t\tif ( copy === 'shallow' ) {\n\t\t\tlevel += 1;\n\t\t} else if ( copy === 'deep' ) {\n\t\t\tlevel += 2;\n\t\t}\n\t\tN = arr.length;\n\t\tout = deepCopy( arr, level );\n\n\t\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\t\tfor ( i = N - 1; i > 0; i-- ) {\n\t\t\t// Generate an integer index on the interval [0,i]:\n\t\t\tj = floor( rand() * (i+1.0) );\n\n\t\t\t// Swap elements:\n\t\t\ttmp = out[ i ];\n\t\t\tout[ i ] = out[ j ];\n\t\t\tout[ j ] = tmp;\n\t\t}\n\n\t\tif ( strflg ) {\n\t\t\tout = arr.join( '' );\n\t\t}\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random permutation of elements in `arr`.\n*\n* @name shuffle\n* @type {Function}\n* @param {ArrayLike} arr - array-like object to shuffle\n* @param {Options} [options] - function options\n* @param {string} [options.copy=\"shallow\"] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n* @throws {TypeError} options must be an object\n* @throws {TypeError} must provide valid options\n* @returns {ArrayLike} the shuffled array-like object\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data, {\n* 'copy': 'none'\n* });\n* var bool = ( data === out );\n* // returns true\n*/\nvar shuffle = factory();\n\n\n// EXPORTS //\n\nmodule.exports = shuffle;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a random permutation of elements from an array-like object.\n*\n* @module @stdlib/random/shuffle\n*\n* @example\n* var shuffle = require( '@stdlib/random/shuffle' );\n*\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* out = shuffle( data, {\n* 'copy': 'none'\n* });\n*\n* var bool = ( data === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:arcsine' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rarcsine = require( './../../../base/arcsine' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an arcsine distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rarcsine( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/streams/arcsine\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:bernoulli' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbern = require( './../../../base/bernoulli' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @constructor\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 0.5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( p, options );\n\t\t}\n\t\treturn new RandomStream( p );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbern( p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 0.7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( p, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.3 ) );\n* }\n*/\nfunction factory( p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isProbability( p ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( p ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', p ) );\n\t\t\t}\n\t\t\topts = assign( {}, p );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( p ) {\n\t\treturn new RandomStream( p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/streams/bernoulli\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:beta' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbeta = require( './../../../base/beta' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a beta distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbeta( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/streams/beta\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:betaprime' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbetaprime = require( './../../../base/betaprime' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a beta prime distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbetaprime( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/streams/betaprime\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:binomial' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbinom = require( './../../../base/binomial' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a binomial distribution.\n*\n* @constructor\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20, 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( n, p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( n, p, options );\n\t\t}\n\t\treturn new RandomStream( n, p );\n\t}\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbinom( n, p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20, 0.1, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( n, p, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( n, p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20, 0.5 ) );\n* }\n*/\nfunction factory( n, p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( n ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', n ) );\n\t\t}\n\t\topts = assign( {}, n );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} n - number of trials\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `n` must be a positive integer\n\t* @throws {TypeError} `p` must be a positive probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( n, p ) {\n\t\treturn new RandomStream( n, p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `n` must be a positive integer\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( n, p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/streams/binomial\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 20, 0.4, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20, 0.4 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 20, 0.4, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:box-muller' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/box-muller' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @module @stdlib/random/streams/box-muller\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:cauchy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rcauchy = require( './../../../base/cauchy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @constructor\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( x0, gamma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( x0, gamma, options );\n\t\t}\n\t\treturn new RandomStream( x0, gamma );\n\t}\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositiveNumber( gamma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rcauchy( x0, gamma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( x0, gamma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( x0, gamma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( x0, gamma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( x0 ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', x0 ) );\n\t\t}\n\t\topts = assign( {}, x0 );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @param {number} x0 - location parameter\n\t* @param {PositiveNumber} gamma - scale parameter\n\t* @throws {TypeError} `gamma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( x0, gamma ) {\n\t\treturn new RandomStream( x0, gamma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `gamma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( x0, gamma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/streams/cauchy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:chi' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rchi = require( './../../../base/chi' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a chi distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( k, options );\n\t\t}\n\t\treturn new RandomStream( k );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rchi( k, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( k, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( k ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( k ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t\t}\n\t\t\topts = assign( {}, k );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k ) {\n\t\treturn new RandomStream( k, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/streams/chi\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:chisquare' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rchisquare = require( './../../../base/chisquare' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a chi-square distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( k, options );\n\t\t}\n\t\treturn new RandomStream( k );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rchisquare( k, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, opts );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( k, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options);\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( k ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( k ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t\t}\n\t\t\topts = assign( {}, k );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k ) {\n\t\treturn new RandomStream( k, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/streams/chisquare\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:cosine' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rcosine = require( './../../../base/cosine' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @constructor\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, s, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, s, options );\n\t\t}\n\t\treturn new RandomStream( mu, s );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rcosine( mu, s, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, s, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, s, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, s, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, s ) {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/streams/cosine\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:discrete-uniform' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rduniform = require( './../../../base/discrete-uniform' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @constructor\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2, 5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isInteger( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rduniform( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2, 5, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n\t*\n\t* @private\n\t* @param {integer} a - minimum support\n\t* @param {integer} b - maximum support\n\t* @throws {TypeError} `a` must be an integer\n\t* @throws {TypeError} `b` must be an integer\n\t* @throws {RangeError} `a` must be less than or equal to `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be an integer\n\t* @throws {TypeError} `b` must be an integer\n\t* @throws {RangeError} `a` must be less than or equal to `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/streams/discrete-uniform\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2, 5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2, 5, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:erlang' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rerlang = require( './../../../base/erlang' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an Erlang distribution.\n*\n* @constructor\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( k, lambda, options );\n\t\t}\n\t\treturn new RandomStream( k, lambda );\n\t}\n\tif ( !isPositiveInteger( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rerlang( k, lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5.0 ) );\n* }\n*/\nfunction factory( k, lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t}\n\t\topts = assign( {}, k );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} k - shape parameter\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @throws {TypeError} `k` must be a positive integer\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k, lambda ) {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive integer\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/streams/erlang\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:exponential' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rexponential = require( './../../../base/exponential' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an exponential distribution.\n*\n* @constructor\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( lambda, options );\n\t\t}\n\t\treturn new RandomStream( lambda );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rexponential( lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( lambda ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( lambda ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', lambda ) );\n\t\t\t}\n\t\t\topts = assign( {}, lambda );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( lambda ) {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/streams/exponential\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:f' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rf = require( './../../../base/f' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an F distribution.\n*\n* @constructor\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( d1, d2, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( d1, d2, options );\n\t\t}\n\t\treturn new RandomStream( d1, d2 );\n\t}\n\tif ( !isPositiveNumber( d1 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositiveNumber( d2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rf( d1, d2, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( d1, d2, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( d1, d2, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( d1, d2, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( d1 ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', d1 ) );\n\t\t}\n\t\topts = assign( {}, d1 );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an F distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} d1 - degrees of freedom\n\t* @param {PositiveNumber} d2 - degrees of freedom\n\t* @throws {TypeError} `d1` must be a positive number\n\t* @throws {TypeError} `d2` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( d1, d2 ) {\n\t\treturn new RandomStream( d1, d2, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an F distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `d1` must be a positive number\n\t* @throws {TypeError} `d2` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( d1, d2, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/streams/f\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:frechet' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rfrechet = require( './../../../base/frechet' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @constructor\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, 1.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, s, m, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( alpha, s, m, options );\n\t\t}\n\t\treturn new RandomStream( alpha, s, m );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number and not NaN. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number. Value: `%s`.', m ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rfrechet( alpha, s, m, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, -1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, s, m, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, s, m, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 0.0 ) );\n* }\n*/\nfunction factory( alpha, s, m, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {number} m - location parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} `m` must be a number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, s, m ) {\n\t\treturn new RandomStream( alpha, s, m, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} `m` must be a number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, s, m, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/streams/frechet\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, 3.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, -2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, 0.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:gamma' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgamma = require( './../../../base/gamma' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a gamma distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgamma( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/streams/gamma\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:geometric' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgeom = require( './../../../base/geometric' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a geometric distribution.\n*\n* @constructor\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 0.5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( p, options );\n\t\t}\n\t\treturn new RandomStream( p );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgeom( p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 0.7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( p, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.3 ) );\n* }\n*/\nfunction factory( p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isProbability( p ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( p ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', p ) );\n\t\t\t}\n\t\t\topts = assign( {}, p );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( p ) {\n\t\treturn new RandomStream( p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/streams/geometric\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:gumbel' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgumbel = require( './../../../base/gumbel' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, beta, options );\n\t\t}\n\t\treturn new RandomStream( mu, beta );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgumbel( mu, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, beta ) {\n\t\treturn new RandomStream( mu, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/streams/gumbel\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:hypergeometric' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rhypergeom = require( './../../../base/hypergeometric' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @constructor\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {RangeError} `K` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20, 10, 7, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( N, K, n, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( N, K, n, options );\n\t\t}\n\t\treturn new RandomStream( N, K, n );\n\t}\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\tthrow new RangeError( 'invalid argument. Third argument must be less than or equal to the first argument.' );\n\t}\n\tif ( K > N ) {\n\t\tthrow new RangeError( 'invalid argument. Second argument must be less than or equal to the first argument.' );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rhypergeom( N, K, n, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {RangeError} `K` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20, 10, 7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( N, K, n, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( N, K, n, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 5, 3, 2 ) );\n* }\n*/\nfunction factory( N, K, n, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( N ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', N ) );\n\t\t}\n\t\topts = assign( {}, N );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} N - population size\n\t* @param {NonNegativeInteger} K - subpopulation size\n\t* @param {NonNegativeInteger} n - number of draws\n\t* @throws {TypeError} `N` must be a nonnegative integer\n\t* @throws {TypeError} `K` must be a nonnegative integer\n\t* @throws {TypeError} `n` must be a nonnegative integer\n\t* @throws {RangeError} `n` must be less than or equal to `N`\n\t* @throws {RangeError} `K` must be less than or equal to `N`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( N, K, n ) {\n\t\treturn new RandomStream( N, K, n, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `N` must be a nonnegative integer\n\t* @throws {TypeError} `K` must be a nonnegative integer\n\t* @throws {TypeError} `n` must be a nonnegative integer\n\t* @throws {RangeError} `n` must be less than or equal to `N`\n\t* @throws {RangeError} `K` must be less than or equal to `N`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( N, K, n, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/streams/hypergeometric\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 5, 3, 2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 5, 3, 2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 5, 3, 2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:improved-ziggurat' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @module @stdlib/random/streams/improved-ziggurat\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:invgamma' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rinvgamma = require( './../../../base/invgamma' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rinvgamma( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/streams/invgamma\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:kumaraswamy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rkumaraswamy = require( './../../../base/kumaraswamy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @constructor\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isPositiveNumber( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rkumaraswamy( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} a - first shape parameter\n\t* @param {PositiveNumber} b - second shape parameter\n\t* @throws {TypeError} `a` must be a positive number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a positive number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/streams/kumaraswamy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:laplace' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlaplace = require( './../../../base/laplace' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, b, options );\n\t\t}\n\t\treturn new RandomStream( mu, b );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlaplace( mu, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} b - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, b ) {\n\t\treturn new RandomStream( mu, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/streams/laplace\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:levy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlevy = require( './../../../base/levy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, c, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, c, options );\n\t\t}\n\t\treturn new RandomStream( mu, c );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlevy( mu, c, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, c, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, c, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, c, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} c - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `c` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, c ) {\n\t\treturn new RandomStream( mu, c, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `c` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, c, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/streams/levy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:logistic' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlogistic = require( './../../../base/logistic' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a logistic distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, s, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, s, options );\n\t\t}\n\t\treturn new RandomStream( mu, s );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlogistic( mu, s, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, s, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, s, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, s, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, s ) {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/streams/logistic\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:lognormal' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlognormal = require( './../../../base/lognormal' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a lognormal distribution.\n*\n* @constructor\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, sigma, options );\n\t\t}\n\t\treturn new RandomStream( mu, sigma );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlognormal( mu, sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, sigma ) {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/streams/lognormal\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.0, 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:minstd' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar minstd = require( './../../../base/minstd' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMINSTD} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMINSTD} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMINSTD} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = minstd( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMINSTD}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMINSTD}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/streams/minstd\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:minstd-shuffle' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar minstd = require( './../../../base/minstd-shuffle' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMINSTD} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMINSTD} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMINSTD} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = minstd( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMINSTD}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMINSTD}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/streams/minstd-shuffle\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:mt19937' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMT19937} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMT19937} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = mt19937( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMT19937}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMT19937}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/streams/mt19937\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:negative-binomial' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rnbinom = require( './../../../base/negative-binomial' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a binomial distribution.\n*\n* @constructor\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20.0, 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( r, p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( r, p, options );\n\t\t}\n\t\treturn new RandomStream( r, p );\n\t}\n\tif ( !isPositiveNumber( r ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', r ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rnbinom( r, p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20.0, 0.1, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( r, p, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( r, p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {Probability} [p] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20.0, 0.5 ) );\n* }\n*/\nfunction factory( r, p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( r ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', r ) );\n\t\t}\n\t\topts = assign( {}, r );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} r - number of trials\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `r` must be a positive number\n\t* @throws {TypeError} `p` must be a positive probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( r, p ) {\n\t\treturn new RandomStream( r, p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `r` must be a positive number\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( r, p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/streams/negative-binomial\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 20.0, 0.4, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20.0, 0.4 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 20.0, 0.4, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:normal' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rnorm = require( './../../../base/normal' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a normal distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, sigma, options );\n\t\t}\n\t\treturn new RandomStream( mu, sigma );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rnorm( mu, sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, sigma ) {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/streams/normal\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.0, 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:pareto1' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rpareto1 = require( './../../../base/pareto-type1' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rpareto1( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/streams/pareto-type1\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:poisson' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rpoisson = require( './../../../base/poisson' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Poisson distribution.\n*\n* @constructor\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( lambda, options );\n\t\t}\n\t\treturn new RandomStream( lambda );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rpoisson( lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} [lambda] - mean\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( lambda ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( lambda ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', lambda ) );\n\t\t\t}\n\t\t\topts = assign( {}, lambda );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - mean\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( lambda ) {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/streams/poisson\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"mt19937\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randi' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randi = require( './../../../base/randi' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {*} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {*} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {*} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers having integer values.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randi( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {*}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {*}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers having integer values.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/streams/randi\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"improved-ziggurat\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randn' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/randn' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers from a standard normal distribution.\n*\n* @module @stdlib/random/streams/randn\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"mt19937\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randu' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randu = require( './../../../base/randu' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {*} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {*} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {*} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randu( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {*}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {*}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {Function} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/streams/randu\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:rayleigh' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rrayleigh = require( './../../../base/rayleigh' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @constructor\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( sigma, options );\n\t\t}\n\t\treturn new RandomStream( sigma );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rrayleigh( sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( sigma ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( sigma ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', sigma ) );\n\t\t\t}\n\t\t\topts = assign( {}, sigma );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( sigma ) {\n\t\treturn new RandomStream( sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( sigma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/streams/rayleigh\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:t' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rt = require( './../../../base/t' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Student's t distribution.\n*\n* @constructor\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( v, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( v, options );\n\t\t}\n\t\treturn new RandomStream( v );\n\t}\n\tif ( !isPositiveNumber( v ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rt( v, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( v, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( v, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( v, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( v ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( v ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', v ) );\n\t\t\t}\n\t\t\topts = assign( {}, v );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} v - degrees of freedom\n\t* @throws {TypeError} `v` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( v ) {\n\t\treturn new RandomStream( v, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `v` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( v, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @module @stdlib/random/streams/t\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:triangular' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rtriang = require( './../../../base/triangular' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a uniform distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, c, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( a, b, c, options );\n\t\t}\n\t\treturn new RandomStream( a, b, c );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\tthrow new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rtriang( a, b, c, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, c, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, c, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 4.0 ) );\n* }\n*/\nfunction factory( a, b, c, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {number} c - mode\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {TypeError} `c` must be a number\n\t* @throws {RangeError} arguments must satisfy `a <= c <= b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b, c ) {\n\t\treturn new RandomStream( a, b, c, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {TypeError} `c` must be a number\n\t* @throws {RangeError} arguments must satisfy `a <= c <= b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, c, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/streams/triangular\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:uniform' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar runiform = require( './../../../base/uniform' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a uniform distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', runiform( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a uniform distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n*\n* @module @stdlib/random/streams/uniform\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:weibull' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rweibull = require( './../../../base/weibull' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Weibull distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( k, lambda, options );\n\t\t}\n\t\treturn new RandomStream( k, lambda );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rweibull( k, lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( k, lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t}\n\t\topts = assign( {}, k );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - scale parameter\n\t* @param {PositiveNumber} lambda - shape parameter\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k, lambda ) {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/streams/weibull\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../streams/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../streams/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../streams/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../streams/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../streams/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/box-muller}\n*/\nsetReadOnly( ns, 'boxMuller', require( './../../streams/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../streams/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../streams/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../streams/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../streams/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../streams/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../streams/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../streams/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/f}\n*/\nsetReadOnly( ns, 'f', require( './../../streams/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../streams/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../streams/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../streams/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../streams/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../streams/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/improved-ziggurat}\n*/\nsetReadOnly( ns, 'improvedZiggurat', require( './../../streams/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../streams/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../streams/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../streams/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../streams/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../streams/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../streams/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../streams/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../streams/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../streams/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../streams/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../streams/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../streams/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../streams/poisson' ) );\n\n/**\n* @name randi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randi}\n*/\nsetReadOnly( ns, 'randi', require( './../../streams/randi' ) );\n\n/**\n* @name randn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randn}\n*/\nsetReadOnly( ns, 'randn', require( './../../streams/randn' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../streams/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../streams/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/t}\n*/\nsetReadOnly( ns, 't', require( './../../streams/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../streams/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../streams/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../streams/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/arcsine' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction arcsine( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction arcsine( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/strided/arcsine\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var arcsine = require( '@stdlib/random/strided/arcsine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var arcsine = require( '@stdlib/random/strided/arcsine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/beta' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction beta( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction beta( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/strided/beta\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var beta = require( '@stdlib/random/strided/beta' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var beta = require( '@stdlib/random/strided/beta' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/betaprime' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction betaprime( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction betaprime( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/strided/betaprime\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var betaprime = require( '@stdlib/random/strided/betaprime' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var betaprime = require( '@stdlib/random/strided/betaprime' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/cosine' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {Collection} s - scale parameter\n* @param {integer} ss - `s` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction cosine( N, mu, sm, s, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, s, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, s, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} s - scale parameter\n* @param {integer} ss - `s` stride length\n* @param {NonNegativeInteger} os - starting `s` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction cosine( N, mu, sm, om, s, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, s, ss, os, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, s, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/strided/cosine\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var cosine = require( '@stdlib/random/strided/cosine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var cosine = require( '@stdlib/random/strided/cosine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/discrete-uniform' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than or equal to maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1 );\n*/\nfunction discreteUniform( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than or equal to maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 1, 0 );\n*/\nfunction discreteUniform( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/strided/discrete-uniform\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform.ndarray( out.length, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/exponential' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 1;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar unary = require( '@stdlib/strided/base/unary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} lambda - rate parameter\n* @param {integer} sl - `lambda` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, out, 1 );\n*/\nfunction exponential( N, lambda, sl, out, so, options ) {\n\tvar rand = prng( lambda, sl, 0, arguments.length > 5, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tunary( [ lambda, out ], [ N ], [ sl, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar unary = require( '@stdlib/strided/base/unary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} lambda - scale parameter\n* @param {integer} sl - `lambda` stride length\n* @param {NonNegativeInteger} ol - starting `lambda` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\nfunction exponential( N, lambda, sl, ol, out, so, oo, options ) {\n\tvar rand = prng( lambda, sl, ol, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tunary( [ lambda, out ], [ N ], [ sl, so ], [ ol, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/strided/exponential\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/strided/exponential' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/strided/exponential' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/gamma' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - rate parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction gamma( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - rate parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction gamma( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/strided/gamma\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var gamma = require( '@stdlib/random/strided/gamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var gamma = require( '@stdlib/random/strided/gamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/invgamma' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - scale parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction invgamma( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - scale parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction invgamma( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/strided/invgamma\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var invgamma = require( '@stdlib/random/strided/invgamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var invgamma = require( '@stdlib/random/strided/invgamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/lognormal' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - location parameter\n* @param {integer} sm - `mu` stride length\n* @param {Collection} sigma - scale parameter\n* @param {integer} ss - `sigma` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction lognormal( N, mu, sm, sigma, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, sigma, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - location parameter\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} sigma - scale parameter\n* @param {integer} ss - `sigma` stride length\n* @param {NonNegativeInteger} os - starting `sigma` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction lognormal( N, mu, sm, om, sigma, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, sigma, ss, os, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/strided/lognormal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var lognormal = require( '@stdlib/random/strided/lognormal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var lognormal = require( '@stdlib/random/strided/lognormal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @module @stdlib/random/strided/minstd\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/strided/minstd-shuffle\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*/\nfunction mt19937( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1, 0 );\n*/\nfunction mt19937( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*/\nfunction mt19937( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1, 0 );\n*/\nfunction mt19937( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/strided/mt19937\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/normal' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {Collection} sigma - standard deviation\n* @param {integer} ss - `sigma` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction normal( N, mu, sm, sigma, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, sigma, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} sigma - standard deviation\n* @param {integer} ss - `sigma` stride length\n* @param {NonNegativeInteger} os - starting `sigma` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction normal( N, mu, sm, om, sigma, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, sigma, ss, os, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/strided/normal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var normal = require( '@stdlib/random/strided/normal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var normal = require( '@stdlib/random/strided/normal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/randu' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1 );\n*/\nfunction randu( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/randu' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1, 0 );\n*/\nfunction randu( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/strided/randu\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var randu = require( '@stdlib/random/strided/randu' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var randu = require( '@stdlib/random/strided/randu' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu.ndarray( out.length, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/uniform' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction uniform( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction uniform( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/strided/uniform\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var uniform = require( '@stdlib/random/strided/uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var uniform = require( '@stdlib/random/strided/uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/weibull' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - scale parameter\n* @param {integer} sk - `k` stride length\n* @param {Collection} lambda - shape parameter\n* @param {integer} sl - `lambda` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction weibull( N, k, sk, lambda, sl, out, so, options ) {\n\tvar rand = prng( k, sk, 0, lambda, sl, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ k, lambda, out ], [ N ], [ sk, sl, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - scale parameter\n* @param {integer} sk - `k` stride length\n* @param {NonNegativeInteger} ok - starting `k` index\n* @param {Collection} lambda - shape parameter\n* @param {integer} sl - `lambda` stride length\n* @param {NonNegativeInteger} ol - starting `lambda` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction weibull( N, k, sk, ok, lambda, sl, ol, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( k, sk, ok, lambda, sl, ol, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ k, lambda, out ], [ N ], [ sk, sl, so ], [ ok, ol, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/strided/weibull\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var weibull = require( '@stdlib/random/strided/weibull' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var weibull = require( '@stdlib/random/strided/weibull' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../strided/arcsine' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../strided/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../strided/betaprime' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../strided/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../strided/discrete-uniform' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../strided/exponential' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../strided/gamma' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../strided/invgamma' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../strided/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../strided/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../strided/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../strided/mt19937' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../strided/normal' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../strided/randu' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../strided/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../strided/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name array\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/array}\n*/\nsetReadOnly( ns, 'array', require( './../array' ) );\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/base}\n*/\nsetReadOnly( ns, 'base', require( './../base' ) );\n\n/**\n* @name iterators\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/iter}\n*/\nsetReadOnly( ns, 'iterators', require( './../iter' ) );\n\n/**\n* @name sample\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/sample}\n*/\nsetReadOnly( ns, 'sample', require( './../sample' ) );\n\n/**\n* @name shuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/shuffle}\n*/\nsetReadOnly( ns, 'shuffle', require( './../shuffle' ) );\n\n/**\n* @name streams\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/streams}\n*/\nsetReadOnly( ns, 'streams', require( './../streams' ) );\n\n/**\n* @name strided\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/strided}\n*/\nsetReadOnly( ns, 'strided', require( './../strided' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"], - "mappings": "uGAAA,IAAAA,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cAsBA,IAAIC,GAAa,QAAS,8BAA+B,EACrDC,GAAQ,QAAS,iCAAkC,EAKnDC,GAAMF,GAAa,EAevB,SAASG,IAAa,CACrB,IAAIC,EAAIH,GAAO,EAAOC,GAAI,KAAK,OAAO,CAAG,EACzC,OAAOE,IAAM,CACd,CAKAL,GAAO,QAAUI,KCnDjB,IAAAE,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cA+DA,IAAIC,GAAc,QAAS,uDAAwD,EAC/EC,GAAsB,QAAS,uDAAwD,EACvFC,GAAuB,QAAS,wDAAyD,EACzFC,GAAa,QAAS,iCAAkC,EACxDC,GAAW,QAAS,gCAAiC,EACrDC,GAAe,QAAS,8BAA+B,EACvDC,GAAgB,QAAS,+BAAgC,EACzDC,GAAY,QAAS,2BAA4B,EAAE,YACnDC,GAAoB,QAAS,oCAAqC,EAAE,YACpEC,GAA2B,QAAS,4CAA6C,EACjFC,GAAa,QAAS,8BAA+B,EACrDC,EAAc,QAAS,sBAAuB,EAC9CC,GAAM,QAAS,+BAAgC,EAC/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IAA4C,EAS9ED,EAAaC,EAAI,UAAW,IAAqC,EASjED,EAAaC,EAAI,SAAU,IAAoC,EAS/DD,EAAaC,EAAI,QAAS,IAAmC,EAS7DD,EAAaC,EAAI,UAAW,IAAqC,EASjED,EAAaC,EAAI,UAAW,IAAqC,EAKjEF,GAAO,QAAUE,IC/JjB,IAAIC,GAAc,QAAS,yCAA0C,EAUjEC,GAAK,CAAC,EASVD,GAAaC,GAAI,QAAS,IAAwB,EASlDD,GAAaC,GAAI,OAAQ,IAAuB,EAShDD,GAAaC,GAAI,YAAa,IAAuB,EASrDD,GAAaC,GAAI,SAAU,IAAyB,EASpDD,GAAaC,GAAI,UAAW,IAA0B,EAStDD,GAAaC,GAAI,UAAW,IAA0B,EAStDD,GAAaC,GAAI,UAAW,IAA0B,EAKtD,OAAO,QAAUA", - "names": ["require_rand_uint32", "__commonJSMin", "exports", "module", "UINT32_MAX", "floor", "MAX", "randuint32", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isCollection", "isUint32Array", "isBoolean", "isPositiveInteger", "FLOAT64_MAX_SAFE_INTEGER", "UINT32_MAX", "Uint32Array", "max", "umul", "gcopy", "typedarray2json", "format", "randuint32", "N", "M", "MAX_SEED", "SEED_ARRAY_INIT_STATE", "UPPER_MASK", "LOWER_MASK", "KNUTH_MULTIPLIER", "MAGIC_MULTIPLIER_1", "MAGIC_MULTIPLIER_2", "TEMPERING_COEFFICIENT_1", "TEMPERING_COEFFICIENT_2", "MATRIX_A", "MAG01", "FLOAT64_NORMALIZATION_CONSTANT", "TWO_26", "TWO_32", "ONE", "MAX_NORMALIZED", "STATE_ARRAY_VERSION", "NUM_STATE_SECTIONS", "STATE_SECTION_OFFSET", "OTHER_SECTION_OFFSET", "SEED_SECTION_OFFSET", "STATE_FIXED_LENGTH", "verifyState", "state", "FLG", "s1", "createState", "s", "i", "initState", "seed", "j", "k", "twist", "w", "factory", "options", "STATE", "opts", "slen", "err", "mt19937", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "out", "r", "x", "y", "require_main", "__commonJSMin", "exports", "module", "factory", "randuint32", "mt19937", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "require_arcsine", "__commonJSMin", "exports", "module", "pow", "sin", "HALF_PI", "arcsine", "rand", "a", "b", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "arcsine0", "factory", "opts", "rand", "prng", "err", "a", "b", "arcsine2", "arcsine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "arcsine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "arcsine2", "arcsine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "a", "b", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "arcsine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_coords_array", "__commonJSMin", "exports", "module", "sqrt", "exp", "ln", "V", "coordsArray", "N", "rTail", "X", "f", "i", "require_ratio_array", "__commonJSMin", "exports", "module", "ratioArray", "X", "R", "require_sample_tail", "__commonJSMin", "exports", "module", "ln", "sampleTail", "rand", "rTail", "isNegative", "x", "y", "require_improved_ziggurat", "__commonJSMin", "exports", "module", "abs", "exp", "coordsArray", "ratioArray", "sampleTail", "NUM_BLOCKS", "START_RIGHT_TAIL", "X", "R", "LAST_7_BITS_MASK", "wrap", "randu", "randi", "randn", "f0", "f1", "x2", "x", "u", "i", "j", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isFunction", "isObject", "isBoolean", "hasOwnProp", "isUint32Array", "mt19937", "constantFunction", "noop", "floor", "UINT32_MAX", "typedarray2json", "format", "improvedZiggurat", "factory", "options", "randu", "randi", "randn", "opts", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randn", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_standard_gamma", "__commonJSMin", "exports", "module", "ln", "sqrt", "pow", "ONE_THIRD", "standardGamma", "randu", "randn", "alpha", "flg", "x2", "v0", "v1", "c", "d", "x", "s", "u", "v", "require_sample1", "__commonJSMin", "exports", "module", "pow", "ln", "sample", "randu", "randn", "alpha", "flg", "s4", "A", "s", "t", "u", "x", "y", "require_sample2", "__commonJSMin", "exports", "module", "pow", "ln", "sample", "randu", "randn", "alpha", "beta", "sigma", "flg", "mu", "A", "B", "C", "L", "s", "u", "x", "y", "require_sample3", "__commonJSMin", "exports", "module", "exp", "pow", "ln", "sample", "rand", "alpha", "beta", "lx", "ly", "xy", "v", "x", "y", "require_beta", "__commonJSMin", "exports", "module", "standardGamma", "sample1", "sample2", "sample3", "sample", "randu", "randn", "alpha", "beta", "ga", "gb", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "randu", "isnan", "gcopy", "Uint32Array", "isUint32Array", "assign", "typedarray2json", "format", "validate", "beta0", "factory", "STATE", "rnorm", "alpha", "beta", "opts", "rand", "prng", "FLG", "err", "beta2", "beta1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "beta", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "beta2", "beta1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "alpha", "beta", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "beta", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_gamma", "__commonJSMin", "exports", "module", "ln", "gamma", "randu", "randn", "beta", "d", "c", "flg", "x2", "v0", "v1", "x", "u", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isUint32Array", "isBoolean", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "randu", "isnan", "sqrt", "pow", "gcopy", "Uint32Array", "typedarray2json", "assign", "format", "validate", "gamma0", "ONE_THIRD", "factory", "STATE", "alpha", "rnorm", "beta", "opts", "rand", "prng", "FLG", "err", "c", "d", "gamma2", "gamma1a", "gamma1b", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "gamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_betaprime", "__commonJSMin", "exports", "module", "sample", "rgamma", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "constantFunction", "noop", "gammaFactory", "isnan", "typedarray2json", "format", "validate", "betaprime0", "factory", "rgamma", "alpha", "beta", "opts", "rand", "prng", "err", "betaprime2", "betaprime1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "betaprime", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "betaprime2", "betaprime1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "alpha", "beta", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "betaprime", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "s", "require_cosine", "__commonJSMin", "exports", "module", "quantile", "sample", "rand", "mu", "s", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "cosine0", "factory", "opts", "rand", "prng", "err", "mu", "s", "cosine2", "cosine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "cosine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "cosine2", "cosine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "mu", "s", "wrapper", "require_main", "__commonJSMin", "exports", "module", "factory", "cosine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isInteger", "format", "isnan", "validate", "a", "b", "require_discrete_uniform", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "floor", "discreteUniform", "rand", "a", "b", "result", "RANGE", "range", "limit", "bsize", "mult", "MIN", "MAX", "inc", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randi", "isnan", "isInteger", "typedarray2json", "format", "validate", "discreteUniform0", "factory", "opts", "rand", "prng", "err", "a", "b", "discreteUniform2", "discreteUniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "discreteUniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "uniform2", "uniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "a", "b", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "discreteUniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_exponential", "__commonJSMin", "exports", "module", "ln", "exponential", "rand", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "exponential0", "factory", "lambda", "opts", "rand", "prng", "exponential2", "exponential1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isNumber", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "unary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "exponential2", "exponential1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "lambda", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "gamma2", "gamma1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "alpha", "beta", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "gamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_geometric", "__commonJSMin", "exports", "module", "floor", "ln", "geometric", "rand", "p", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isProbability", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "geometric0", "factory", "opts", "rand", "prng", "p", "geometric2", "geometric1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "geometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isNumber", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "unary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "geometric2", "geometric1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "p", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "geometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "gamma", "isnan", "typedarray2json", "format", "validate", "factory", "rgamma", "alpha", "beta", "opts", "rand", "prng", "err", "invgamma2", "invgamma1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "invgamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "invgamma2", "invgamma1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "alpha", "beta", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "invgamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "sigma", "require_lognormal", "__commonJSMin", "exports", "module", "exp", "lognormal", "randn", "mu", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "isnan", "typedarray2json", "format", "validate", "lognormal0", "factory", "sigma", "rnorm", "opts", "rand", "prng", "err", "mu", "lognormal2", "lognormal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "lognormal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "lognormal2", "lognormal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "mu", "sigma", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "lognormal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_rand_int32", "__commonJSMin", "exports", "module", "INT32_MAX", "floor", "MAX", "randint32", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isBoolean", "isCollection", "isPositiveInteger", "isInt32Array", "format", "INT32_MAX", "Int32Array", "gcopy", "typedarray2json", "randint32", "NORMALIZATION_CONSTANT", "MAX_SEED", "A", "STATE_ARRAY_VERSION", "NUM_STATE_SECTIONS", "STATE_SECTION_OFFSET", "SEED_SECTION_OFFSET", "STATE_FIXED_LENGTH", "verifyState", "state", "FLG", "s1", "factory", "options", "STATE", "opts", "seed", "slen", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randint32", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_create_table", "__commonJSMin", "exports", "module", "isnan", "NUM_WARMUPS", "createTable", "rand", "table", "N", "v", "i", "require_rand_int32", "__commonJSMin", "exports", "module", "INT32_MAX", "floor", "MAX", "randint32", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isBoolean", "isCollection", "isPositiveInteger", "isInt32Array", "gcopy", "floor", "Int32Array", "INT32_MAX", "typedarray2json", "format", "createTable", "randint32", "NORMALIZATION_CONSTANT", "MAX_SEED", "A", "TABLE_LENGTH", "STATE_ARRAY_VERSION", "NUM_STATE_SECTIONS", "TABLE_SECTION_OFFSET", "STATE_SECTION_OFFSET", "SEED_SECTION_OFFSET", "STATE_FIXED_LENGTH", "SHUFFLE_STATE", "PRNG_STATE", "verifyState", "state", "FLG", "s1", "factory", "options", "STATE", "opts", "seed", "slen", "err", "minstd", "minstdShuffle", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "s", "out", "i", "require_main", "__commonJSMin", "exports", "module", "factory", "randint32", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "mt19937", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "mt19937", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "sigma", "require_normal", "__commonJSMin", "exports", "module", "normal", "rand", "mu", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "isnan", "typedarray2json", "format", "validate", "normal0", "factory", "sigma", "rnorm", "opts", "rand", "prng", "err", "mu", "normal2", "normal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "normal2", "normal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "mu", "sigma", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "minstd", "minstdShuffle", "mt19937", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "typedarray2json", "format", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "uniform", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randu", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "randu", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "randu", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "require_uniform", "__commonJSMin", "exports", "module", "uniform", "rand", "a", "b", "r", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "uniform0", "factory", "opts", "rand", "prng", "err", "a", "b", "uniform2", "uniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "uniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "uniform2", "uniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "a", "b", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "uniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isProbability", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "factory", "opts", "rand", "prng", "p", "bernoulli2", "bernoulli1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "bernoulli", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositiveInteger", "isProbability", "format", "validate", "n", "p", "require_sample1", "__commonJSMin", "exports", "module", "sample", "rand", "n", "p", "sum", "i", "require_correction", "__commonJSMin", "exports", "module", "pow", "ONE_12", "ONE_360", "ONE_1260", "correction", "k", "v", "require_sample2", "__commonJSMin", "exports", "module", "floor", "sign", "sqrt", "abs", "ln", "correction", "ONE_SIXTH", "sample", "rand", "n", "p", "alpha", "urvr", "snpq", "npq", "rho", "tmp", "nm", "nr", "us", "km", "nk", "vr", "a", "b", "c", "f", "h", "i", "k", "m", "q", "r", "t", "u", "v", "x", "require_binomial", "__commonJSMin", "exports", "module", "sample1", "sample2", "sample", "rand", "n", "p", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "isPositiveInteger", "isProbability", "randu", "typedarray2json", "format", "validate", "binomial0", "factory", "opts", "rand", "prng", "err", "p", "binomial2", "binomial1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "n", "require_main", "__commonJSMin", "exports", "module", "factory", "binomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_randn", "__commonJSMin", "exports", "module", "sqrt", "ln", "sin", "cos", "TWO_PI", "wrap", "rand", "flg", "r", "randn", "u1", "u2", "a", "b", "require_min", "__commonJSMin", "exports", "module", "sqrt", "ln", "cos", "PI", "COS_PI", "getMin", "min", "a", "require_max", "__commonJSMin", "exports", "module", "sqrt", "ln", "cos", "TWO_PI", "getMax", "min", "a", "b", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "isBoolean", "hasOwnProp", "isUint32Array", "mt19937", "constantFunction", "noop", "typedarray2json", "format", "randn0", "getMin", "getMax", "factory", "options", "randu", "randn", "rand", "opts", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randn", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "x0", "gamma", "require_cauchy", "__commonJSMin", "exports", "module", "tan", "PI", "cauchy", "randn", "x0", "gamma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "randn", "typedarray2json", "format", "validate", "cauchy0", "factory", "gamma", "rnorm", "opts", "rand", "prng", "err", "x0", "cauchy2", "cauchy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "cauchy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "gamma", "typedarray2json", "format", "factory", "rgamma", "rand", "opts", "prng", "k", "chisquare2", "chisquare1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "chisquare", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "chisquare", "typedarray2json", "sqrt", "format", "factory", "rchisq", "rand", "opts", "prng", "k", "chi2", "chi1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "chi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "isPositiveInteger", "format", "validate", "k", "lambda", "require_erlang", "__commonJSMin", "exports", "module", "ln", "erlang", "rand", "k", "lambda", "prod", "i", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "isPositiveInteger", "typedarray2json", "format", "validate", "erlang0", "factory", "lambda", "rand", "opts", "prng", "err", "k", "erlang2", "erlang1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "erlang", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "d1", "d2", "require_f", "__commonJSMin", "exports", "module", "f", "rchisq", "d1", "d2", "x1", "x2", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "chisquare", "isnan", "typedarray2json", "format", "validate", "f0", "factory", "rchisq", "opts", "rand", "prng", "err", "d1", "d2", "f2", "f1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "f", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositiveNumber", "isNumber", "isnan", "format", "validate", "alpha", "s", "m", "require_frechet", "__commonJSMin", "exports", "module", "pow", "ln", "frechet", "rand", "alpha", "s", "m", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "frechet0", "factory", "alpha", "opts", "rand", "prng", "err", "s", "m", "frechet2", "frechet1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "frechet", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "beta", "require_gumbel", "__commonJSMin", "exports", "module", "ln", "gumbel", "rand", "mu", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "gumbel0", "factory", "beta", "opts", "rand", "prng", "err", "mu", "gumbel2", "gumbel1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "gumbel", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "format", "validate", "N", "K", "n", "require_hin", "__commonJSMin", "exports", "module", "factorial", "hin", "rand", "n1", "n2", "k", "p", "u", "x", "require_hypergeometric", "__commonJSMin", "exports", "module", "hin", "hypergeometric", "rand", "N", "K", "n", "n1", "n2", "k", "x", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isNonNegativeInteger", "PINF", "typedarray2json", "format", "validate", "hypergeometric0", "factory", "opts", "rand", "prng", "err", "N", "K", "n", "hypergeometric2", "hypergeometric1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "hypergeometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "a", "b", "require_kumaraswamy", "__commonJSMin", "exports", "module", "pow", "sample", "rand", "a", "b", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "kumaraswamy0", "factory", "opts", "rand", "prng", "err", "a", "b", "kumaraswamy2", "kumaraswamy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "kumaraswamy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "b", "require_laplace", "__commonJSMin", "exports", "module", "sign", "abs", "ln", "laplace", "rand", "mu", "b", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "laplace0", "factory", "opts", "rand", "prng", "err", "mu", "b", "laplace2", "laplace1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "laplace", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "c", "require_levy", "__commonJSMin", "exports", "module", "normalQuantile", "levy", "rand", "mu", "c", "z", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "levy0", "factory", "opts", "rand", "prng", "err", "mu", "c", "levy2", "levy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "levy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "isnan", "format", "validate", "mu", "s", "require_logistic", "__commonJSMin", "exports", "module", "ln", "logistic", "rand", "mu", "s", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "logistic0", "factory", "opts", "rand", "prng", "err", "mu", "s", "logistic2", "logistic1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "logistic", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_knuth", "__commonJSMin", "exports", "module", "exp", "poisson", "rand", "lambda", "p", "k", "require_rejection", "__commonJSMin", "exports", "module", "factorialln", "floor", "sign", "sqrt", "abs", "ln", "LN_SQRT_TWO_PI", "ONE_12", "ONE_360", "poisson", "rand", "lambda", "slambda", "ainv", "urvr", "us", "vr", "a", "b", "k", "u", "v", "require_poisson", "__commonJSMin", "exports", "module", "knuth", "rejection", "poisson", "rand", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "poisson0", "factory", "lambda", "opts", "rand", "prng", "poisson2", "poisson1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "poisson", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "isNumber", "format", "isnan", "validate", "p", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isUint32Array", "isBoolean", "isFunction", "constantFunction", "noop", "isnan", "poisson", "gamma", "gcopy", "Uint32Array", "assign", "typedarray2json", "format", "validate", "factory", "rgamma", "STATE", "rpois", "opts", "prng", "rand", "FLG", "err", "p", "r", "negativeBinomial2", "negativeBinomial1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "negativeBinomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_pareto", "__commonJSMin", "exports", "module", "pow", "pareto", "rand", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "pareto0", "factory", "alpha", "beta", "opts", "rand", "prng", "err", "pareto2", "pareto1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "pareto1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "minstd", "minstdShuffle", "mt19937", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "typedarray2json", "format", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "randi", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "boxMuller", "improvedZiggurat", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "constantFunction", "format", "noop", "typedarray2json", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "normal", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_rayleigh", "__commonJSMin", "exports", "module", "sqrt", "ln", "rayleigh", "rand", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "rayleigh0", "factory", "sigma", "opts", "rand", "prng", "rayleigh2", "rayleigh1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "rayleigh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isPositive", "isObject", "isUint32Array", "isBoolean", "isnan", "isFunction", "constantFunction", "noop", "chisquare", "randn", "gcopy", "Uint32Array", "assign", "typedarray2json", "format", "sqrt", "factory", "rchisq", "STATE", "rnorm", "rand", "opts", "prng", "FLG", "v", "t2", "t1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "t", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "c", "require_triangular", "__commonJSMin", "exports", "module", "sqrt", "triangular", "rand", "a", "b", "c", "fc", "x", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "triangular0", "factory", "opts", "rand", "prng", "err", "a", "b", "c", "triangular2", "triangular1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "triangular", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "k", "lambda", "require_weibull", "__commonJSMin", "exports", "module", "pow", "ln", "weibull", "rand", "k", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "weibull0", "factory", "lambda", "opts", "rand", "prng", "err", "k", "weibull2", "weibull1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "weibull", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prngs", "__commonJSMin", "exports", "module", "prng0", "prng1", "prng2", "prng3", "prng4", "prng5", "prng6", "prng7", "prng8", "prng9", "prng10", "prng11", "prng12", "prng13", "prng14", "prng15", "prng16", "prng17", "prng18", "prng19", "prng20", "prng21", "prng22", "prng23", "prng24", "prng25", "prng26", "prng27", "prng28", "prng29", "prng30", "prng31", "prng32", "prng33", "prng34", "prng35", "prng36", "prng37", "prng38", "prng39", "prng40", "prngs", "require_main", "__commonJSMin", "exports", "module", "isString", "isObject", "isArray", "contains", "Int32Array", "Uint32Array", "table", "TYPED_ARRAY_CTORS", "PRNG_WRAPPERS", "reviveBasePRNG", "key", "value", "factory", "opts", "args", "ctor", "tmp", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "random", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rarcsine", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbern", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbeta", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbetaprime", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isPositiveInteger", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbinom", "iteratorSymbol", "format", "iterator", "n", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rcauchy", "iteratorSymbol", "format", "iterator", "x0", "gamma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rchi", "iteratorSymbol", "format", "iterator", "k", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rchisq", "iteratorSymbol", "format", "iterator", "k", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rcosine", "iteratorSymbol", "format", "iterator", "mu", "s", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isInteger", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "runif", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "isPositiveInteger", "hasOwnProp", "MAX_VALUE", "rerlang", "iteratorSymbol", "format", "iterator", "k", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rexp", "iteratorSymbol", "format", "iterator", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rf", "iteratorSymbol", "format", "iterator", "d1", "d2", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNumber", "isnan", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rfrechet", "iteratorSymbol", "format", "iterator", "alpha", "s", "m", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rgamma", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rgeom", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rgumbel", "iteratorSymbol", "format", "iterator", "mu", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rhypergeom", "iteratorSymbol", "format", "iterator", "N", "K", "n", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rinvgamma", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rkumaraswamy", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlaplace", "iteratorSymbol", "format", "iterator", "mu", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlevy", "iteratorSymbol", "format", "iterator", "mu", "c", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlogis", "iteratorSymbol", "format", "iterator", "mu", "s", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlognorm", "iteratorSymbol", "format", "iterator", "mu", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "minstd", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "minstd", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "mt19937", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isPositiveNumber", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnbinom", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "mu", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rpareto", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rpois", "iteratorSymbol", "format", "iterator", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randi", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randn", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randu", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rrayleigh", "iteratorSymbol", "format", "iterator", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rt", "iteratorSymbol", "format", "iterator", "v", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rtriangular", "iteratorSymbol", "format", "iterator", "a", "b", "c", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "runif", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rweibull", "iteratorSymbol", "format", "iterator", "k", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_discrete_uniform", "__commonJSMin", "exports", "module", "floor", "discreteUniform", "x", "size", "rand", "pos", "out", "N", "i", "require_renormalizing", "__commonJSMin", "exports", "module", "renormalizing", "x", "size", "rand", "probabilities", "probs", "psum", "out", "N", "i", "j", "k", "u", "require_fisher_yates", "__commonJSMin", "exports", "module", "floor", "slice", "fisherYates", "x", "size", "rand", "tmp", "N", "i", "j", "require_vose", "__commonJSMin", "exports", "module", "floor", "vose", "x", "size", "rand", "probabilities", "small", "large", "probs", "alias", "out", "N", "p", "g", "i", "l", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isUnityProbabilityArray", "hasOwnProp", "isBoolean", "isObject", "format", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "isArrayLike", "isTypedArrayLike", "isString", "format", "randu", "copy", "discreteUniform", "renormalizing", "fisherYates", "vose", "defaults", "validate", "slice", "factory", "config", "pool", "conf", "rand", "err", "fcn", "sample1", "sample2", "x", "options", "replace", "xcopy", "probs", "opts", "size", "mutate", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "sample", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "hasOwnProp", "isString", "isObject", "indexOf", "format", "COPY_OPTIONS", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "isArrayLike", "isTypedArrayLike", "isString", "deepCopy", "floor", "randu", "format", "defaults", "validate", "factory", "config", "conf", "rand", "err", "shuffle", "arr", "options", "strflg", "level", "copy", "opts", "out", "tmp", "N", "i", "j", "require_main", "__commonJSMin", "exports", "module", "factory", "shuffle", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rarcsine", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbern", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "isProbability", "format", "assign", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbeta", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbetaprime", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveInteger", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbinom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "n", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "n", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "n", "p", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rcauchy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "x0", "gamma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "x0", "gamma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "x0", "gamma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rchi", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "isPositive", "assign", "format", "RandomStream", "factory", "k", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rchisquare", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rcosine", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "s", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "s", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isInteger", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rduniform", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveInteger", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rerlang", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "lambda", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rexponential", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "lambda", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rf", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "d1", "d2", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "d1", "d2", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "d1", "d2", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rfrechet", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "m", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "s", "m", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "s", "m", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgamma", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgeom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isProbability", "isPlainObject", "assign", "format", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgumbel", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNonNegativeInteger", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rhypergeom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "N", "K", "n", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "N", "K", "n", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "N", "K", "n", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rinvgamma", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rkumaraswamy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlaplace", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlevy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "c", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "c", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "c", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlogistic", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "s", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "s", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlognormal", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "sigma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "minstd", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "minstd", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "mt19937", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rnbinom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "r", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rnorm", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "sigma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rpareto1", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rpoisson", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "lambda", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randi", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randu", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rrayleigh", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "sigma", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rt", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "v", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "v", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "v", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rtriang", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "c", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "c", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "c", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "runiform", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rweibull", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "lambda", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "arcsine", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "arcsine", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "beta", "N", "alpha", "sa", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "beta", "N", "alpha", "sa", "oa", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "betaprime", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "betaprime", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "s", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "om", "s", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "hasOptions", "options", "out", "v1", "require_main", "__commonJSMin", "exports", "module", "nullary", "unary", "prng", "exponential", "N", "lambda", "sl", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "unary", "prng", "exponential", "N", "lambda", "sl", "ol", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "invgamma", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "invgamma", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "lognormal", "N", "mu", "sm", "sigma", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "lognormal", "N", "mu", "sm", "om", "sigma", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "normal", "N", "mu", "sm", "sigma", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "normal", "N", "mu", "sm", "om", "sigma", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "randu", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "randu", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "uniform", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "uniform", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "weibull", "N", "k", "sk", "lambda", "sl", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "weibull", "N", "k", "sk", "ok", "lambda", "sl", "ol", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "setReadOnly", "ns"] + "sources": ["../base/mt19937/lib/rand_uint32.js", "../base/mt19937/lib/factory.js", "../base/mt19937/lib/main.js", "../base/mt19937/lib/index.js", "../base/arcsine/lib/validate.js", "../base/arcsine/lib/arcsine.js", "../base/arcsine/lib/factory.js", "../base/arcsine/lib/main.js", "../base/arcsine/lib/index.js", "../array/arcsine/lib/defaults.json", "../array/arcsine/lib/validate.js", "../array/arcsine/lib/factory.js", "../array/arcsine/lib/main.js", "../array/arcsine/lib/index.js", "../base/improved-ziggurat/lib/coords_array.js", "../base/improved-ziggurat/lib/ratio_array.js", "../base/improved-ziggurat/lib/sample_tail.js", "../base/improved-ziggurat/lib/improved_ziggurat.js", "../base/improved-ziggurat/lib/factory.js", "../base/improved-ziggurat/lib/main.js", "../base/improved-ziggurat/lib/index.js", "../base/beta/lib/validate.js", "../base/beta/lib/standard_gamma.js", "../base/beta/lib/sample1.js", "../base/beta/lib/sample2.js", "../base/beta/lib/sample3.js", "../base/beta/lib/beta.js", "../base/beta/lib/factory.js", "../base/beta/lib/main.js", "../base/beta/lib/index.js", "../array/beta/lib/defaults.json", "../array/beta/lib/validate.js", "../array/beta/lib/factory.js", "../array/beta/lib/main.js", "../array/beta/lib/index.js", "../base/gamma/lib/validate.js", "../base/gamma/lib/gamma.js", "../base/gamma/lib/factory.js", "../base/gamma/lib/main.js", "../base/gamma/lib/index.js", "../base/betaprime/lib/validate.js", "../base/betaprime/lib/betaprime.js", "../base/betaprime/lib/factory.js", "../base/betaprime/lib/main.js", "../base/betaprime/lib/index.js", "../array/betaprime/lib/defaults.json", "../array/betaprime/lib/validate.js", "../array/betaprime/lib/factory.js", "../array/betaprime/lib/main.js", "../array/betaprime/lib/index.js", "../base/cosine/lib/validate.js", "../base/cosine/lib/cosine.js", "../base/cosine/lib/factory.js", "../base/cosine/lib/main.js", "../base/cosine/lib/index.js", "../array/cosine/lib/defaults.json", "../array/cosine/lib/validate.js", "../array/cosine/lib/factory.js", "../array/cosine/lib/main.js", "../array/cosine/lib/index.js", "../base/discrete-uniform/lib/validate.js", "../base/discrete-uniform/lib/discrete_uniform.js", "../base/discrete-uniform/lib/factory.js", "../base/discrete-uniform/lib/main.js", "../base/discrete-uniform/lib/index.js", "../array/discrete-uniform/lib/defaults.json", "../array/discrete-uniform/lib/validate.js", "../array/discrete-uniform/lib/factory.js", "../array/discrete-uniform/lib/main.js", "../array/discrete-uniform/lib/index.js", "../array/tools/unary/lib/validate.js", "../array/tools/unary/lib/main.js", "../array/tools/unary/lib/index.js", "../array/tools/nullary/lib/validate.js", "../array/tools/nullary/lib/main.js", "../array/tools/nullary/lib/index.js", "../array/tools/unary-factory/lib/main.js", "../array/tools/unary-factory/lib/index.js", "../base/exponential/lib/exponential.js", "../base/exponential/lib/factory.js", "../base/exponential/lib/main.js", "../base/exponential/lib/index.js", "../array/exponential/lib/factory.js", "../array/exponential/lib/main.js", "../array/exponential/lib/index.js", "../array/gamma/lib/defaults.json", "../array/gamma/lib/validate.js", "../array/gamma/lib/factory.js", "../array/gamma/lib/main.js", "../array/gamma/lib/index.js", "../base/geometric/lib/geometric.js", "../base/geometric/lib/factory.js", "../base/geometric/lib/main.js", "../base/geometric/lib/index.js", "../array/geometric/lib/factory.js", "../array/geometric/lib/main.js", "../array/geometric/lib/index.js", "../base/invgamma/lib/validate.js", "../base/invgamma/lib/factory.js", "../base/invgamma/lib/main.js", "../base/invgamma/lib/index.js", "../array/invgamma/lib/defaults.json", "../array/invgamma/lib/validate.js", "../array/invgamma/lib/factory.js", "../array/invgamma/lib/main.js", "../array/invgamma/lib/index.js", "../base/lognormal/lib/validate.js", "../base/lognormal/lib/lognormal.js", "../base/lognormal/lib/factory.js", "../base/lognormal/lib/main.js", "../base/lognormal/lib/index.js", "../array/lognormal/lib/defaults.json", "../array/lognormal/lib/validate.js", "../array/lognormal/lib/factory.js", "../array/lognormal/lib/main.js", "../array/lognormal/lib/index.js", "../base/minstd/lib/rand_int32.js", "../base/minstd/lib/factory.js", "../base/minstd/lib/main.js", "../base/minstd/lib/index.js", "../array/minstd/lib/defaults.json", "../array/minstd/lib/validate.js", "../array/minstd/lib/factory.js", "../array/minstd/lib/main.js", "../array/minstd/lib/index.js", "../base/minstd-shuffle/lib/create_table.js", "../base/minstd-shuffle/lib/rand_int32.js", "../base/minstd-shuffle/lib/factory.js", "../base/minstd-shuffle/lib/main.js", "../base/minstd-shuffle/lib/index.js", "../array/minstd-shuffle/lib/defaults.json", "../array/minstd-shuffle/lib/validate.js", "../array/minstd-shuffle/lib/factory.js", "../array/minstd-shuffle/lib/main.js", "../array/minstd-shuffle/lib/index.js", "../array/mt19937/lib/defaults.json", "../array/mt19937/lib/validate.js", "../array/mt19937/lib/factory.js", "../array/mt19937/lib/main.js", "../array/mt19937/lib/index.js", "../base/normal/lib/validate.js", "../base/normal/lib/normal.js", "../base/normal/lib/factory.js", "../base/normal/lib/main.js", "../base/normal/lib/index.js", "../array/normal/lib/defaults.json", "../array/normal/lib/validate.js", "../array/normal/lib/factory.js", "../array/normal/lib/main.js", "../array/normal/lib/index.js", "../base/randu/lib/defaults.json", "../base/randu/lib/prngs.js", "../base/randu/lib/factory.js", "../base/randu/lib/main.js", "../base/randu/lib/index.js", "../array/randu/lib/defaults.json", "../array/randu/lib/validate.js", "../array/randu/lib/factory.js", "../array/randu/lib/main.js", "../array/randu/lib/index.js", "../base/uniform/lib/validate.js", "../base/uniform/lib/uniform.js", "../base/uniform/lib/factory.js", "../base/uniform/lib/main.js", "../base/uniform/lib/index.js", "../array/uniform/lib/defaults.json", "../array/uniform/lib/validate.js", "../array/uniform/lib/factory.js", "../array/uniform/lib/main.js", "../array/uniform/lib/index.js", "../array/lib/index.js", "../base/bernoulli/lib/factory.js", "../base/bernoulli/lib/main.js", "../base/bernoulli/lib/index.js", "../base/binomial/lib/validate.js", "../base/binomial/lib/sample1.js", "../base/binomial/lib/correction.js", "../base/binomial/lib/sample2.js", "../base/binomial/lib/binomial.js", "../base/binomial/lib/factory.js", "../base/binomial/lib/main.js", "../base/binomial/lib/index.js", "../base/box-muller/lib/randn.js", "../base/box-muller/lib/min.js", "../base/box-muller/lib/max.js", "../base/box-muller/lib/factory.js", "../base/box-muller/lib/main.js", "../base/box-muller/lib/index.js", "../base/cauchy/lib/validate.js", "../base/cauchy/lib/cauchy.js", "../base/cauchy/lib/factory.js", "../base/cauchy/lib/main.js", "../base/cauchy/lib/index.js", "../base/chisquare/lib/factory.js", "../base/chisquare/lib/main.js", "../base/chisquare/lib/index.js", "../base/chi/lib/factory.js", "../base/chi/lib/main.js", "../base/chi/lib/index.js", "../base/erlang/lib/validate.js", "../base/erlang/lib/erlang.js", "../base/erlang/lib/factory.js", "../base/erlang/lib/main.js", "../base/erlang/lib/index.js", "../base/f/lib/validate.js", "../base/f/lib/f.js", "../base/f/lib/factory.js", "../base/f/lib/main.js", "../base/f/lib/index.js", "../base/frechet/lib/validate.js", "../base/frechet/lib/frechet.js", "../base/frechet/lib/factory.js", "../base/frechet/lib/main.js", "../base/frechet/lib/index.js", "../base/gumbel/lib/validate.js", "../base/gumbel/lib/gumbel.js", "../base/gumbel/lib/factory.js", "../base/gumbel/lib/main.js", "../base/gumbel/lib/index.js", "../base/hypergeometric/lib/validate.js", "../base/hypergeometric/lib/hin.js", "../base/hypergeometric/lib/hypergeometric.js", "../base/hypergeometric/lib/factory.js", "../base/hypergeometric/lib/main.js", "../base/hypergeometric/lib/index.js", "../base/kumaraswamy/lib/validate.js", "../base/kumaraswamy/lib/kumaraswamy.js", "../base/kumaraswamy/lib/factory.js", "../base/kumaraswamy/lib/main.js", "../base/kumaraswamy/lib/index.js", "../base/laplace/lib/validate.js", "../base/laplace/lib/laplace.js", "../base/laplace/lib/factory.js", "../base/laplace/lib/main.js", "../base/laplace/lib/index.js", "../base/levy/lib/validate.js", "../base/levy/lib/levy.js", "../base/levy/lib/factory.js", "../base/levy/lib/main.js", "../base/levy/lib/index.js", "../base/logistic/lib/validate.js", "../base/logistic/lib/logistic.js", "../base/logistic/lib/factory.js", "../base/logistic/lib/main.js", "../base/logistic/lib/index.js", "../base/poisson/lib/knuth.js", "../base/poisson/lib/rejection.js", "../base/poisson/lib/poisson.js", "../base/poisson/lib/factory.js", "../base/poisson/lib/main.js", "../base/poisson/lib/index.js", "../base/negative-binomial/lib/validate.js", "../base/negative-binomial/lib/factory.js", "../base/negative-binomial/lib/main.js", "../base/negative-binomial/lib/index.js", "../base/pareto-type1/lib/validate.js", "../base/pareto-type1/lib/pareto.js", "../base/pareto-type1/lib/factory.js", "../base/pareto-type1/lib/main.js", "../base/pareto-type1/lib/index.js", "../base/randi/lib/defaults.json", "../base/randi/lib/prngs.js", "../base/randi/lib/factory.js", "../base/randi/lib/main.js", "../base/randi/lib/index.js", "../base/randn/lib/defaults.json", "../base/randn/lib/prngs.js", "../base/randn/lib/factory.js", "../base/randn/lib/main.js", "../base/randn/lib/index.js", "../base/rayleigh/lib/rayleigh.js", "../base/rayleigh/lib/factory.js", "../base/rayleigh/lib/main.js", "../base/rayleigh/lib/index.js", "../base/t/lib/factory.js", "../base/t/lib/main.js", "../base/t/lib/index.js", "../base/triangular/lib/validate.js", "../base/triangular/lib/triangular.js", "../base/triangular/lib/factory.js", "../base/triangular/lib/main.js", "../base/triangular/lib/index.js", "../base/weibull/lib/validate.js", "../base/weibull/lib/weibull.js", "../base/weibull/lib/factory.js", "../base/weibull/lib/main.js", "../base/weibull/lib/index.js", "../base/reviver/lib/prngs.js", "../base/reviver/lib/main.js", "../base/reviver/lib/index.js", "../base/lib/index.js", "../iter/arcsine/lib/main.js", "../iter/arcsine/lib/index.js", "../iter/bernoulli/lib/main.js", "../iter/bernoulli/lib/index.js", "../iter/beta/lib/main.js", "../iter/beta/lib/index.js", "../iter/betaprime/lib/main.js", "../iter/betaprime/lib/index.js", "../iter/binomial/lib/main.js", "../iter/binomial/lib/index.js", "../iter/box-muller/lib/main.js", "../iter/box-muller/lib/index.js", "../iter/cauchy/lib/main.js", "../iter/cauchy/lib/index.js", "../iter/chi/lib/main.js", "../iter/chi/lib/index.js", "../iter/chisquare/lib/main.js", "../iter/chisquare/lib/index.js", "../iter/cosine/lib/main.js", "../iter/cosine/lib/index.js", "../iter/discrete-uniform/lib/main.js", "../iter/discrete-uniform/lib/index.js", "../iter/erlang/lib/main.js", "../iter/erlang/lib/index.js", "../iter/exponential/lib/main.js", "../iter/exponential/lib/index.js", "../iter/f/lib/main.js", "../iter/f/lib/index.js", "../iter/frechet/lib/main.js", "../iter/frechet/lib/index.js", "../iter/gamma/lib/main.js", "../iter/gamma/lib/index.js", "../iter/geometric/lib/main.js", "../iter/geometric/lib/index.js", "../iter/gumbel/lib/main.js", "../iter/gumbel/lib/index.js", "../iter/hypergeometric/lib/main.js", "../iter/hypergeometric/lib/index.js", "../iter/improved-ziggurat/lib/main.js", "../iter/improved-ziggurat/lib/index.js", "../iter/invgamma/lib/main.js", "../iter/invgamma/lib/index.js", "../iter/kumaraswamy/lib/main.js", "../iter/kumaraswamy/lib/index.js", "../iter/laplace/lib/main.js", "../iter/laplace/lib/index.js", "../iter/levy/lib/main.js", "../iter/levy/lib/index.js", "../iter/logistic/lib/main.js", "../iter/logistic/lib/index.js", "../iter/lognormal/lib/main.js", "../iter/lognormal/lib/index.js", "../iter/minstd/lib/main.js", "../iter/minstd/lib/index.js", "../iter/minstd-shuffle/lib/main.js", "../iter/minstd-shuffle/lib/index.js", "../iter/mt19937/lib/main.js", "../iter/mt19937/lib/index.js", "../iter/negative-binomial/lib/main.js", "../iter/negative-binomial/lib/index.js", "../iter/normal/lib/main.js", "../iter/normal/lib/index.js", "../iter/pareto-type1/lib/main.js", "../iter/pareto-type1/lib/index.js", "../iter/poisson/lib/main.js", "../iter/poisson/lib/index.js", "../iter/randi/lib/main.js", "../iter/randi/lib/index.js", "../iter/randn/lib/main.js", "../iter/randn/lib/index.js", "../iter/randu/lib/main.js", "../iter/randu/lib/index.js", "../iter/rayleigh/lib/main.js", "../iter/rayleigh/lib/index.js", "../iter/t/lib/main.js", "../iter/t/lib/index.js", "../iter/triangular/lib/main.js", "../iter/triangular/lib/index.js", "../iter/uniform/lib/main.js", "../iter/uniform/lib/index.js", "../iter/weibull/lib/main.js", "../iter/weibull/lib/index.js", "../iter/lib/index.js", "../sample/lib/discrete_uniform.js", "../sample/lib/renormalizing.js", "../sample/lib/fisher_yates.js", "../sample/lib/vose.js", "../sample/lib/defaults.json", "../sample/lib/validate.js", "../sample/lib/factory.js", "../sample/lib/main.js", "../sample/lib/index.js", "../shuffle/lib/defaults.json", "../shuffle/lib/validate.js", "../shuffle/lib/factory.js", "../shuffle/lib/main.js", "../shuffle/lib/index.js", "../streams/arcsine/lib/defaults.json", "../streams/arcsine/lib/validate.js", "../streams/arcsine/lib/debug.js", "../streams/arcsine/lib/main.js", "../streams/arcsine/lib/object_mode.js", "../streams/arcsine/lib/factory.js", "../streams/arcsine/lib/index.js", "../streams/bernoulli/lib/defaults.json", "../streams/bernoulli/lib/validate.js", "../streams/bernoulli/lib/debug.js", "../streams/bernoulli/lib/main.js", "../streams/bernoulli/lib/object_mode.js", "../streams/bernoulli/lib/factory.js", "../streams/bernoulli/lib/index.js", "../streams/beta/lib/defaults.json", "../streams/beta/lib/validate.js", "../streams/beta/lib/debug.js", "../streams/beta/lib/main.js", "../streams/beta/lib/object_mode.js", "../streams/beta/lib/factory.js", "../streams/beta/lib/index.js", "../streams/betaprime/lib/defaults.json", "../streams/betaprime/lib/validate.js", "../streams/betaprime/lib/debug.js", "../streams/betaprime/lib/main.js", "../streams/betaprime/lib/object_mode.js", "../streams/betaprime/lib/factory.js", "../streams/betaprime/lib/index.js", "../streams/binomial/lib/defaults.json", "../streams/binomial/lib/validate.js", "../streams/binomial/lib/debug.js", "../streams/binomial/lib/main.js", "../streams/binomial/lib/object_mode.js", "../streams/binomial/lib/factory.js", "../streams/binomial/lib/index.js", "../streams/box-muller/lib/defaults.json", "../streams/box-muller/lib/validate.js", "../streams/box-muller/lib/debug.js", "../streams/box-muller/lib/main.js", "../streams/box-muller/lib/object_mode.js", "../streams/box-muller/lib/factory.js", "../streams/box-muller/lib/index.js", "../streams/cauchy/lib/defaults.json", "../streams/cauchy/lib/validate.js", "../streams/cauchy/lib/debug.js", "../streams/cauchy/lib/main.js", "../streams/cauchy/lib/object_mode.js", "../streams/cauchy/lib/factory.js", "../streams/cauchy/lib/index.js", "../streams/chi/lib/defaults.json", "../streams/chi/lib/validate.js", "../streams/chi/lib/debug.js", "../streams/chi/lib/main.js", "../streams/chi/lib/object_mode.js", "../streams/chi/lib/factory.js", "../streams/chi/lib/index.js", "../streams/chisquare/lib/defaults.json", "../streams/chisquare/lib/validate.js", "../streams/chisquare/lib/debug.js", "../streams/chisquare/lib/main.js", "../streams/chisquare/lib/object_mode.js", "../streams/chisquare/lib/factory.js", "../streams/chisquare/lib/index.js", "../streams/cosine/lib/defaults.json", "../streams/cosine/lib/validate.js", "../streams/cosine/lib/debug.js", "../streams/cosine/lib/main.js", "../streams/cosine/lib/object_mode.js", "../streams/cosine/lib/factory.js", "../streams/cosine/lib/index.js", "../streams/discrete-uniform/lib/defaults.json", "../streams/discrete-uniform/lib/validate.js", "../streams/discrete-uniform/lib/debug.js", "../streams/discrete-uniform/lib/main.js", "../streams/discrete-uniform/lib/object_mode.js", "../streams/discrete-uniform/lib/factory.js", "../streams/discrete-uniform/lib/index.js", "../streams/erlang/lib/defaults.json", "../streams/erlang/lib/validate.js", "../streams/erlang/lib/debug.js", "../streams/erlang/lib/main.js", "../streams/erlang/lib/object_mode.js", "../streams/erlang/lib/factory.js", "../streams/erlang/lib/index.js", "../streams/exponential/lib/defaults.json", "../streams/exponential/lib/validate.js", "../streams/exponential/lib/debug.js", "../streams/exponential/lib/main.js", "../streams/exponential/lib/object_mode.js", "../streams/exponential/lib/factory.js", "../streams/exponential/lib/index.js", "../streams/f/lib/defaults.json", "../streams/f/lib/validate.js", "../streams/f/lib/debug.js", "../streams/f/lib/main.js", "../streams/f/lib/object_mode.js", "../streams/f/lib/factory.js", "../streams/f/lib/index.js", "../streams/frechet/lib/defaults.json", "../streams/frechet/lib/validate.js", "../streams/frechet/lib/debug.js", "../streams/frechet/lib/main.js", "../streams/frechet/lib/object_mode.js", "../streams/frechet/lib/factory.js", "../streams/frechet/lib/index.js", "../streams/gamma/lib/defaults.json", "../streams/gamma/lib/validate.js", "../streams/gamma/lib/debug.js", "../streams/gamma/lib/main.js", "../streams/gamma/lib/object_mode.js", "../streams/gamma/lib/factory.js", "../streams/gamma/lib/index.js", "../streams/geometric/lib/defaults.json", "../streams/geometric/lib/validate.js", "../streams/geometric/lib/debug.js", "../streams/geometric/lib/main.js", "../streams/geometric/lib/object_mode.js", "../streams/geometric/lib/factory.js", "../streams/geometric/lib/index.js", "../streams/gumbel/lib/defaults.json", "../streams/gumbel/lib/validate.js", "../streams/gumbel/lib/debug.js", "../streams/gumbel/lib/main.js", "../streams/gumbel/lib/object_mode.js", "../streams/gumbel/lib/factory.js", "../streams/gumbel/lib/index.js", "../streams/hypergeometric/lib/defaults.json", "../streams/hypergeometric/lib/validate.js", "../streams/hypergeometric/lib/debug.js", "../streams/hypergeometric/lib/main.js", "../streams/hypergeometric/lib/object_mode.js", "../streams/hypergeometric/lib/factory.js", "../streams/hypergeometric/lib/index.js", "../streams/improved-ziggurat/lib/defaults.json", "../streams/improved-ziggurat/lib/validate.js", "../streams/improved-ziggurat/lib/debug.js", "../streams/improved-ziggurat/lib/main.js", "../streams/improved-ziggurat/lib/object_mode.js", "../streams/improved-ziggurat/lib/factory.js", "../streams/improved-ziggurat/lib/index.js", "../streams/invgamma/lib/defaults.json", "../streams/invgamma/lib/validate.js", "../streams/invgamma/lib/debug.js", "../streams/invgamma/lib/main.js", "../streams/invgamma/lib/object_mode.js", "../streams/invgamma/lib/factory.js", "../streams/invgamma/lib/index.js", "../streams/kumaraswamy/lib/defaults.json", "../streams/kumaraswamy/lib/validate.js", "../streams/kumaraswamy/lib/debug.js", "../streams/kumaraswamy/lib/main.js", "../streams/kumaraswamy/lib/object_mode.js", "../streams/kumaraswamy/lib/factory.js", "../streams/kumaraswamy/lib/index.js", "../streams/laplace/lib/defaults.json", "../streams/laplace/lib/validate.js", "../streams/laplace/lib/debug.js", "../streams/laplace/lib/main.js", "../streams/laplace/lib/object_mode.js", "../streams/laplace/lib/factory.js", "../streams/laplace/lib/index.js", "../streams/levy/lib/defaults.json", "../streams/levy/lib/validate.js", "../streams/levy/lib/debug.js", "../streams/levy/lib/main.js", "../streams/levy/lib/object_mode.js", "../streams/levy/lib/factory.js", "../streams/levy/lib/index.js", "../streams/logistic/lib/defaults.json", "../streams/logistic/lib/validate.js", "../streams/logistic/lib/debug.js", "../streams/logistic/lib/main.js", "../streams/logistic/lib/object_mode.js", "../streams/logistic/lib/factory.js", "../streams/logistic/lib/index.js", "../streams/lognormal/lib/defaults.json", "../streams/lognormal/lib/validate.js", "../streams/lognormal/lib/debug.js", "../streams/lognormal/lib/main.js", "../streams/lognormal/lib/object_mode.js", "../streams/lognormal/lib/factory.js", "../streams/lognormal/lib/index.js", "../streams/minstd/lib/defaults.json", "../streams/minstd/lib/validate.js", "../streams/minstd/lib/debug.js", "../streams/minstd/lib/main.js", "../streams/minstd/lib/object_mode.js", "../streams/minstd/lib/factory.js", "../streams/minstd/lib/index.js", "../streams/minstd-shuffle/lib/defaults.json", "../streams/minstd-shuffle/lib/validate.js", "../streams/minstd-shuffle/lib/debug.js", "../streams/minstd-shuffle/lib/main.js", "../streams/minstd-shuffle/lib/object_mode.js", "../streams/minstd-shuffle/lib/factory.js", "../streams/minstd-shuffle/lib/index.js", "../streams/mt19937/lib/defaults.json", "../streams/mt19937/lib/validate.js", "../streams/mt19937/lib/debug.js", "../streams/mt19937/lib/main.js", "../streams/mt19937/lib/object_mode.js", "../streams/mt19937/lib/factory.js", "../streams/mt19937/lib/index.js", "../streams/negative-binomial/lib/defaults.json", "../streams/negative-binomial/lib/validate.js", "../streams/negative-binomial/lib/debug.js", "../streams/negative-binomial/lib/main.js", "../streams/negative-binomial/lib/object_mode.js", "../streams/negative-binomial/lib/factory.js", "../streams/negative-binomial/lib/index.js", "../streams/normal/lib/defaults.json", "../streams/normal/lib/validate.js", "../streams/normal/lib/debug.js", "../streams/normal/lib/main.js", "../streams/normal/lib/object_mode.js", "../streams/normal/lib/factory.js", "../streams/normal/lib/index.js", "../streams/pareto-type1/lib/defaults.json", "../streams/pareto-type1/lib/validate.js", "../streams/pareto-type1/lib/debug.js", "../streams/pareto-type1/lib/main.js", "../streams/pareto-type1/lib/object_mode.js", "../streams/pareto-type1/lib/factory.js", "../streams/pareto-type1/lib/index.js", "../streams/poisson/lib/defaults.json", "../streams/poisson/lib/validate.js", "../streams/poisson/lib/debug.js", "../streams/poisson/lib/main.js", "../streams/poisson/lib/object_mode.js", "../streams/poisson/lib/factory.js", "../streams/poisson/lib/index.js", "../streams/randi/lib/defaults.json", "../streams/randi/lib/validate.js", "../streams/randi/lib/debug.js", "../streams/randi/lib/main.js", "../streams/randi/lib/object_mode.js", "../streams/randi/lib/factory.js", "../streams/randi/lib/index.js", "../streams/randn/lib/defaults.json", "../streams/randn/lib/validate.js", "../streams/randn/lib/debug.js", "../streams/randn/lib/main.js", "../streams/randn/lib/object_mode.js", "../streams/randn/lib/factory.js", "../streams/randn/lib/index.js", "../streams/randu/lib/defaults.json", "../streams/randu/lib/validate.js", "../streams/randu/lib/debug.js", "../streams/randu/lib/main.js", "../streams/randu/lib/object_mode.js", "../streams/randu/lib/factory.js", "../streams/randu/lib/index.js", "../streams/rayleigh/lib/defaults.json", "../streams/rayleigh/lib/validate.js", "../streams/rayleigh/lib/debug.js", "../streams/rayleigh/lib/main.js", "../streams/rayleigh/lib/object_mode.js", "../streams/rayleigh/lib/factory.js", "../streams/rayleigh/lib/index.js", "../streams/t/lib/defaults.json", "../streams/t/lib/validate.js", "../streams/t/lib/debug.js", "../streams/t/lib/main.js", "../streams/t/lib/object_mode.js", "../streams/t/lib/factory.js", "../streams/t/lib/index.js", "../streams/triangular/lib/defaults.json", "../streams/triangular/lib/validate.js", "../streams/triangular/lib/debug.js", "../streams/triangular/lib/main.js", "../streams/triangular/lib/object_mode.js", "../streams/triangular/lib/factory.js", "../streams/triangular/lib/index.js", "../streams/uniform/lib/defaults.json", "../streams/uniform/lib/validate.js", "../streams/uniform/lib/debug.js", "../streams/uniform/lib/main.js", "../streams/uniform/lib/object_mode.js", "../streams/uniform/lib/factory.js", "../streams/uniform/lib/index.js", "../streams/weibull/lib/defaults.json", "../streams/weibull/lib/validate.js", "../streams/weibull/lib/debug.js", "../streams/weibull/lib/main.js", "../streams/weibull/lib/object_mode.js", "../streams/weibull/lib/factory.js", "../streams/weibull/lib/index.js", "../streams/lib/index.js", "../strided/arcsine/lib/prng.js", "../strided/arcsine/lib/main.js", "../strided/arcsine/lib/ndarray.js", "../strided/arcsine/lib/index.js", "../strided/beta/lib/prng.js", "../strided/beta/lib/main.js", "../strided/beta/lib/ndarray.js", "../strided/beta/lib/index.js", "../strided/betaprime/lib/prng.js", "../strided/betaprime/lib/main.js", "../strided/betaprime/lib/ndarray.js", "../strided/betaprime/lib/index.js", "../strided/cosine/lib/prng.js", "../strided/cosine/lib/main.js", "../strided/cosine/lib/ndarray.js", "../strided/cosine/lib/index.js", "../strided/discrete-uniform/lib/prng.js", "../strided/discrete-uniform/lib/main.js", "../strided/discrete-uniform/lib/ndarray.js", "../strided/discrete-uniform/lib/index.js", "../strided/exponential/lib/prng.js", "../strided/exponential/lib/main.js", "../strided/exponential/lib/ndarray.js", "../strided/exponential/lib/index.js", "../strided/gamma/lib/prng.js", "../strided/gamma/lib/main.js", "../strided/gamma/lib/ndarray.js", "../strided/gamma/lib/index.js", "../strided/invgamma/lib/prng.js", "../strided/invgamma/lib/main.js", "../strided/invgamma/lib/ndarray.js", "../strided/invgamma/lib/index.js", "../strided/lognormal/lib/prng.js", "../strided/lognormal/lib/main.js", "../strided/lognormal/lib/ndarray.js", "../strided/lognormal/lib/index.js", "../strided/minstd/lib/main.js", "../strided/minstd/lib/ndarray.js", "../strided/minstd/lib/normalized.js", "../strided/minstd/lib/normalized.ndarray.js", "../strided/minstd/lib/index.js", "../strided/minstd-shuffle/lib/main.js", "../strided/minstd-shuffle/lib/ndarray.js", "../strided/minstd-shuffle/lib/normalized.js", "../strided/minstd-shuffle/lib/normalized.ndarray.js", "../strided/minstd-shuffle/lib/index.js", "../strided/mt19937/lib/main.js", "../strided/mt19937/lib/ndarray.js", "../strided/mt19937/lib/normalized.js", "../strided/mt19937/lib/normalized.ndarray.js", "../strided/mt19937/lib/index.js", "../strided/normal/lib/prng.js", "../strided/normal/lib/main.js", "../strided/normal/lib/ndarray.js", "../strided/normal/lib/index.js", "../strided/randu/lib/main.js", "../strided/randu/lib/ndarray.js", "../strided/randu/lib/index.js", "../strided/uniform/lib/prng.js", "../strided/uniform/lib/main.js", "../strided/uniform/lib/ndarray.js", "../strided/uniform/lib/index.js", "../strided/weibull/lib/prng.js", "../strided/weibull/lib/main.js", "../strided/weibull/lib/ndarray.js", "../strided/weibull/lib/index.js", "../strided/lib/index.js", "../lib/index.js"], + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = UINT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\( [1, 2^{32}-1) \\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randuint32();\n* // returns \n*/\nfunction randuint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v >>> 0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = randuint32;\n", "/* eslint-disable max-lines, max-len */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The original C code and copyright notice are from the [source implementation][mt19937]. The implementation has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n* All rights reserved.\n*\n* Redistribution and use in source and binary forms, with or without\n* modification, are permitted provided that the following conditions\n* are met:\n*\n* 1. Redistributions of source code must retain the above copyright\n* notice, this list of conditions and the following disclaimer.\n*\n* 2. Redistributions in binary form must reproduce the above copyright\n* notice, this list of conditions and the following disclaimer in the\n* documentation and/or other materials provided with the distribution.\n*\n* 3. The names of its contributors may not be used to endorse or promote\n* products derived from this software without specific prior written\n* permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n* \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n* ```\n*\n* [mt19937]: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar max = require( '@stdlib/math/base/special/max' );\nvar umul = require( '@stdlib/math/base/ops/umul' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar randuint32 = require( './rand_uint32.js' );\n\n\n// VARIABLES //\n\n// Define the size of the state array (see refs):\nvar N = 624;\n\n// Define a (magic) constant used for indexing into the state array:\nvar M = 397;\n\n// Define the maximum seed: 11111111111111111111111111111111\nvar MAX_SEED = UINT32_MAX >>> 0; // asm type annotation\n\n// For seed arrays, define an initial state (magic) constant: 19650218 => 00000001001010111101011010101010\nvar SEED_ARRAY_INIT_STATE = 19650218 >>> 0; // asm type annotation\n\n// Define a mask for the most significant `w-r` bits, where `w` is the word size (32 bits) and `r` is the separation point of one word (see refs): 2147483648 => 0x80000000 => 10000000000000000000000000000000\nvar UPPER_MASK = 0x80000000 >>> 0; // asm type annotation\n\n// Define a mask for the least significant `r` bits (see refs): 2147483647 => 0x7fffffff => 01111111111111111111111111111111\nvar LOWER_MASK = 0x7fffffff >>> 0; // asm type annotation\n\n// Define a multiplier (see Knuth TAOCP Vol2. 3rd Ed. P.106): 1812433253 => 01101100000001111000100101100101\nvar KNUTH_MULTIPLIER = 1812433253 >>> 0; // asm type annotation\n\n// Define a (magic) multiplier: 1664525 => 00000000000110010110011000001101\nvar MAGIC_MULTIPLIER_1 = 1664525 >>> 0; // asm type annotation\n\n// Define a (magic) multiplier: 1566083941 => 01011101010110001000101101100101\nvar MAGIC_MULTIPLIER_2 = 1566083941 >>> 0; // asm type annotation\n\n// Define a tempering coefficient: 2636928640 => 0x9d2c5680 => 10011101001011000101011010000000\nvar TEMPERING_COEFFICIENT_1 = 0x9d2c5680 >>> 0; // asm type annotation\n\n// Define a tempering coefficient: 4022730752 => 0xefc60000 => 11101111110001100000000000000000\nvar TEMPERING_COEFFICIENT_2 = 0xefc60000 >>> 0; // asm type annotation\n\n// Define a constant vector `a` (see refs): 2567483615 => 0x9908b0df => 10011001000010001011000011011111\nvar MATRIX_A = 0x9908b0df >>> 0; // asm type annotation\n\n// MAG01[x] = x * MATRIX_A; for x = {0,1}\nvar MAG01 = [ 0x0 >>> 0, MATRIX_A >>> 0 ]; // asm type annotation\n\n// Define a normalization constant when generating double-precision floating-point numbers: 2^53 => 9007199254740992\nvar FLOAT64_NORMALIZATION_CONSTANT = 1.0 / ( FLOAT64_MAX_SAFE_INTEGER+1.0 ); // eslint-disable-line id-length\n\n// 2^26: 67108864\nvar TWO_26 = 67108864 >>> 0; // asm type annotation\n\n// 2^32: 2147483648 => 0x80000000 => 10000000000000000000000000000000\nvar TWO_32 = 0x80000000 >>> 0; // asm type annotation\n\n// 1 (as a 32-bit unsigned integer): 1 => 0x1 => 00000000000000000000000000000001\nvar ONE = 0x1 >>> 0; // asm type annotation\n\n// Define the maximum normalized pseudorandom double-precision floating-point number: ( (((2^32-1)>>>5)*2^26)+( (2^32-1)>>>6) ) / 2^53\nvar MAX_NORMALIZED = FLOAT64_MAX_SAFE_INTEGER * FLOAT64_NORMALIZATION_CONSTANT;\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 3; // state, other, seed\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the index offset of the \"other\" section in the state array:\nvar OTHER_SECTION_OFFSET = N + 3; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = N + 5; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = N + 6; // 1 (version) + 1 (num_sections) + 1 (state_length) + N (state) + 1 (other_length) + 1 (state_index) + 1 (seed_length)\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible schema version. Expected: `%s`. Actual: `%s.`', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"state\" section must equal `N`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== N ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, N, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"other\" section must equal `1`...\n\tif ( state[ OTHER_SECTION_OFFSET ] !== 1 ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible section length. Expected: `%u`. Actual: `%u`.', s1, 1, state[ OTHER_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n/**\n* Returns an initial PRNG state.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {PositiveInteger} N - state size\n* @param {uinteger32} s - seed\n* @returns {Uint32Array} state array\n*/\nfunction createState( state, N, s ) {\n\tvar i;\n\n\t// Set the first element of the state array to the provided seed:\n\tstate[ 0 ] = s >>> 0; // equivalent to `s & 0xffffffffUL` in original C implementation\n\n\t// Initialize the remaining state array elements:\n\tfor ( i = 1; i < N; i++ ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_genrand()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (KNUTH_MULTIPLIER * (mt[i-1] ^ (mt[i-1] >> 30)) + i)\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( umul( s, KNUTH_MULTIPLIER ) + i )>>>0; // asm type annotation\n\t}\n\treturn state;\n}\n\n/**\n* Initializes a PRNG state array according to a seed array.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {NonNegativeInteger} N - state array length\n* @param {Collection} seed - seed array\n* @param {NonNegativeInteger} M - seed array length\n* @returns {Uint32Array} state array\n*/\nfunction initState( state, N, seed, M ) {\n\tvar s;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\ti = 1;\n\tj = 0;\n\tfor ( k = max( N, M ); k > 0; k-- ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_by_array()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1664525UL)) + seed[j] + j;\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\ts = ( umul( s, MAGIC_MULTIPLIER_1 ) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( ((state[i]>>>0)^s) + seed[j] + j )>>>0; /* non-linear */ // asm type annotation\n\n\t\ti += 1;\n\t\tj += 1;\n\t\tif ( i >= N ) {\n\t\t\tstate[ 0 ] = state[ N-1 ];\n\t\t\ti = 1;\n\t\t}\n\t\tif ( j >= M ) {\n\t\t\tj = 0;\n\t\t}\n\t}\n\tfor ( k = N-1; k > 0; k-- ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_by_array()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1566083941UL)) - i;\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\ts = ( umul( s, MAGIC_MULTIPLIER_2 ) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( ((state[i]>>>0)^s) - i )>>>0; /* non-linear */ // asm type annotation\n\n\t\ti += 1;\n\t\tif ( i >= N ) {\n\t\t\tstate[ 0 ] = state[ N-1 ];\n\t\t\ti = 1;\n\t\t}\n\t}\n\t// Ensure a non-zero initial state array:\n\tstate[ 0 ] = TWO_32; // MSB (most significant bit) is 1\n\n\treturn state;\n}\n\n/**\n* Updates a PRNG's internal state by generating the next `N` words.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @returns {Uint32Array} state array\n*/\nfunction twist( state ) {\n\tvar w;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tk = N - M;\n\tfor ( i = 0; i < k; i++ ) {\n\t\tw = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );\n\t\tstate[ i ] = state[ i+M ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\t}\n\tj = N - 1;\n\tfor ( ; i < j; i++ ) {\n\t\tw = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );\n\t\tstate[ i ] = state[ i-k ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\t}\n\tw = ( state[j]&UPPER_MASK ) | ( state[0]&LOWER_MASK );\n\tstate[ j ] = state[ M-1 ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\treturn state;\n}\n\n\n// MAIN //\n\n/**\n* Returns a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* ## Notes\n*\n* - In contrast to the original C implementation, array seeds of length `1` are considered integer seeds. This ensures that the seed `[ 1234 ]` generates the same output as the seed `1234`. In the original C implementation, the two seeds would yield different output, which is **not** obvious from a user perspective.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} a seed must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integers less than or equal to the maximum unsigned 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than or equal to the maximum unsigned 32-bit integer\n* @throws {TypeError} state must be a `Uint32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} Mersenne Twister PRNG\n*\n* @example\n* var mt19937 = factory();\n*\n* var v = mt19937();\n* // returns \n*\n* @example\n* // Return a seeded Mersenne Twister PRNG:\n* var mt19937 = factory({\n* 'seed': 1234\n* });\n*\n* var v = mt19937();\n* // returns 822569775\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isUint32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Uint32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state \"view\":\n\t\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed >>>= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) === false || seed.length < 1 ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t} else if ( seed.length === 1 ) {\n\t\t\t\t\tseed = seed[ 0 ];\n\t\t\t\t\tif ( !isPositiveInteger( seed ) ) {\n\t\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed >>>= 0; // asm type annotation\n\t\t\t\t} else {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Uint32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = N;\n\t\t\t\t\tSTATE[ OTHER_SECTION_OFFSET ] = 1;\n\t\t\t\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state \"view\":\n\t\t\t\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate = createState( state, N, SEED_ARRAY_INIT_STATE );\n\t\t\t\t\tstate = initState( state, N, seed, slen );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randuint32() >>> 0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randuint32() >>> 0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Uint32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = N;\n\t\tSTATE[ OTHER_SECTION_OFFSET ] = 1;\n\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state \"view\":\n\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate = createState( state, N, seed );\n\t}\n\t// Note: property order matters in order to maintain consistency of PRNG \"shape\" (hidden classes).\n\tsetReadOnly( mt19937, 'NAME', 'mt19937' );\n\tsetReadOnlyAccessor( mt19937, 'seed', getSeed );\n\tsetReadOnlyAccessor( mt19937, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( mt19937, 'state', getState, setState );\n\tsetReadOnlyAccessor( mt19937, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( mt19937, 'byteLength', getStateSize );\n\tsetReadOnly( mt19937, 'toJSON', toJSON );\n\tsetReadOnly( mt19937, 'MIN', 0 );\n\tsetReadOnly( mt19937, 'MAX', UINT32_MAX );\n\tsetReadOnly( mt19937, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', mt19937.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', 0.0 );\n\tsetReadOnly( normalized, 'MAX', MAX_NORMALIZED );\n\n\treturn mt19937;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Uint32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `3` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. internal PRNG state\n\t* 2. auxiliary state information\n\t* 3. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Uint32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - If PRNG state is \"shared\" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Uint32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state \"view\":\n\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = mt19937.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [0, 2^{32}) \\\\).\n\t*\n\t* @private\n\t* @returns {uinteger32} pseudorandom integer\n\t*\n\t* @example\n\t* var r = mt19937();\n\t* // returns \n\t*/\n\tfunction mt19937() {\n\t\tvar r;\n\t\tvar i;\n\n\t\t// Retrieve the current state index:\n\t\ti = STATE[ OTHER_SECTION_OFFSET+1 ];\n\n\t\t// Determine whether we need to update the PRNG state:\n\t\tif ( i >= N ) {\n\t\t\tstate = twist( state );\n\t\t\ti = 0;\n\t\t}\n\t\t// Get the next word of \"raw\"/untempered state:\n\t\tr = state[ i ];\n\n\t\t// Update the state index:\n\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = i + 1;\n\n\t\t// Tempering transform to compensate for the reduced dimensionality of equidistribution:\n\t\tr ^= r >>> 11;\n\t\tr ^= ( r << 7 ) & TEMPERING_COEFFICIENT_1;\n\t\tr ^= ( r << 15 ) & TEMPERING_COEFFICIENT_2;\n\t\tr ^= r >>> 18;\n\n\t\treturn r >>> 0;\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0, 1) \\\\).\n\t*\n\t* ## Notes\n\t*\n\t* - The original C implementation credits Isaku Wada for this algorithm (2002/01/09).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = normalized();\n\t* // returns \n\t*/\n\tfunction normalized() {\n\t\tvar x = mt19937() >>> 5;\n\t\tvar y = mt19937() >>> 6;\n\t\treturn ( (x*TWO_26)+y ) * FLOAT64_NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\nvar randuint32 = require( './rand_uint32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [0, 2^{32}) \\\\).\n*\n* ## Method\n*\n* - When generating normalized double-precision floating-point numbers, we first generate two pseudorandom integers \\\\( x \\\\) and \\\\( y \\\\) on the interval \\\\( [0, 2^{32}) \\\\) for a combined \\\\( 64 \\\\) random bits.\n*\n* - We would like \\\\( 53 \\\\) random bits to generate a 53-bit precision integer and, thus, want to discard \\\\( 11 \\\\) of the generated bits.\n*\n* - We do so by discarding \\\\( 5 \\\\) bits from \\\\( x \\\\) and \\\\( 6 \\\\) bits from \\\\( y \\\\).\n*\n* - Accordingly, \\\\( x \\\\) contains \\\\( 27 \\\\) random bits, which are subsequently shifted left \\\\( 26 \\\\) bits (multiplied by \\\\( 2^{26} \\\\), and \\\\( y \\\\) contains \\\\( 26 \\\\) random bits to fill in the lower \\\\( 26 \\\\) bits. When summed, they combine to comprise \\\\( 53 \\\\) random bits of a double-precision floating-point integer.\n*\n* - As an example, suppose, for the sake of argument, the 32-bit PRNG generates the maximum unsigned 32-bit integer \\\\( 2^{32}-1 \\\\) twice in a row. Then,\n*\n* ```javascript\n* x = 4294967295 >>> 5; // 00000111111111111111111111111111\n* y = 4294967295 >>> 6; // 00000011111111111111111111111111\n* ```\n*\n* Multiplying \\\\( x \\\\) by \\\\( 2^{26} \\\\) returns \\\\( 9007199187632128 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 10000110011 11111111111111111111 11111100000000000000000000000000\n* ```\n*\n* Adding \\\\( y \\\\) yields \\\\( 9007199254740991 \\\\) (the maximum \"safe\" double-precision floating-point integer value), which, in binary, is\n*\n* ```binarystring\n* 0 10000110011 11111111111111111111 11111111111111111111111111111111\n* ```\n*\n* - Similarly, suppose the 32-bit PRNG generates the following values\n*\n* ```javascript\n* x = 1 >>> 5; // 0 => 00000000000000000000000000000000\n* y = 64 >>> 6; // 1 => 00000000000000000000000000000001\n* ```\n*\n* Multiplying \\\\( x \\\\) by \\\\( 2^{26} \\\\) returns \\\\( 0 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 00000000000 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* Adding \\\\( y \\\\) yields \\\\( 1 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 01111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* - As different combinations of \\\\( x \\\\) and \\\\( y \\\\) are generated, different combinations of double-precision floating-point exponent and significand bits will be toggled, thus generating pseudorandom double-precision floating-point numbers.\n*\n* ## References\n*\n* - Matsumoto, Makoto, and Takuji Nishimura. 1998. \"Mersenne Twister: A 623-dimensionally Equidistributed Uniform Pseudo-random Number Generator.\" _ACM Transactions on Modeling and Computer Simulation_ 8 (1). New York, NY, USA: ACM: 3\u201330. doi:[10.1145/272991.272995][@matsumoto:1998a].\n* - Harase, Shin. 2017. \"Conversion of Mersenne Twister to double-precision floating-point numbers.\" _ArXiv_ abs/1708.06018 (September). .\n*\n* [@matsumoto:1998a]: https://doi.org/10.1145/272991.272995\n*\n* @function mt19937\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = mt19937();\n* // returns \n*/\nvar mt19937 = factory({\n\t'seed': randuint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/base/mt19937\n*\n* @example\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n*\n* var v = mt19937();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/mt19937' ).factory;\n*\n* var mt19937 = factory({\n* 'seed': 1234\n* });\n*\n* var v = mt19937();\n* // returns 822569775\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar sin = require( '@stdlib/math/base/special/sin' );\nvar HALF_PI = require( '@stdlib/constants/float64/half-pi' );\n\n\n// MAIN //\n\n/**\n* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {number} pseudorandom number\n*/\nfunction arcsine( rand, a, b ) {\n\treturn a + ( pow( sin( HALF_PI*rand() ), 2.0 ) * ( b-a ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar arcsine0 = require( './arcsine.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating arcsine distributed random numbers.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var arcsine = factory( 0.0, 1.0 );\n*\n* var v = arcsine();\n* // returns \n*\n* @example\n* var arcsine = factory( -3.0, -1.0, {\n* 'seed': 297\n* });\n* var v = arcsine();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = arcsine2;\n\t} else {\n\t\tprng = arcsine1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'arcsine' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = arcsine1();\n\t* // returns \n\t*/\n\tfunction arcsine1() {\n\t\treturn arcsine0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = arcsine2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = arcsine2( 1.0, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction arcsine2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta >= b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn arcsine0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @name arcsine\n* @type {PRNG}\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = arcsine( 0.0, 1.0 );\n* // returns \n*/\nvar arcsine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Arcsine distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/arcsine\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var v = arcsine( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/arcsine' ).factory;\n*\n* var arcsine = factory( -5.0, 5.0, {\n* 'seed': 297\n* });\n*\n* var v = arcsine();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/arcsine' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var arcsine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = arcsine( 10 );\n* // returns \n*\n* @example\n* var arcsine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = arcsine( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = arcsine2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = arcsine2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = arcsine1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = arcsine1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from an arcsine distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction arcsine1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from an arcsine distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction arcsine2( len, a, b, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ a ], [ b ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( a, b );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an arcsine distribution with minimum support `a` and maximum support `b`.\n*\n* @name arcsine\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = arcsine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = arcsine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar arcsine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from an arcsine distribution with minimum support `a` and maximum support `b`.\n*\n* @module @stdlib/random/array/arcsine\n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var arr = arcsine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var arr = arcsine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var rand = arcsine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var rand = arcsine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// VARIABLES //\n\n// (R*phi(R) + Pr(X>=R))*sqrt(2\\pi)\nvar V = 9.91256303526217e-3;\n\n\n// MAIN //\n\n/**\n* Returns an array containing coordinates such that each rectangle has the same area.\n*\n* @private\n* @param {PositiveInteger} N - number of rectangles\n* @param {number} rTail - start of right tail\n* @returns {NumberArray} coordinate array\n*\n* @example\n* var X = coordsArray( 128, 3.44 );\n* // returns \n*/\nfunction coordsArray( N, rTail ) {\n\tvar X;\n\tvar f;\n\tvar i;\n\n\tf = exp( -0.5 * rTail * rTail );\n\n\tX = [];\n\tX.push( V/f ); // bottom block: V / f(R)\n\tX.push( rTail );\n\tfor ( i = 2; i < N; i++ ) {\n\t\tX[ i ] = sqrt( -2.0 * ln( ( V/X[i-1] ) + f ) );\n\t\tf = exp( -0.5 * X[ i ] * X[ i ] );\n\t}\n\tX.push( 0.0 );\n\treturn X;\n}\n\n\n// EXPORTS //\n\nmodule.exports = coordsArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array containing the ratio of each pair of consecutive elements in order: `X[ i+1 ] / X[ i ]`.\n*\n* @private\n* @param {NumberArray} X - input array\n* @returns {NumberArray} ratio array\n*\n* @example\n* var R = ratioArray( [ 1.0, 2.0, 5.0 ] );\n* // returns [ 2.0, 2.5 ]\n*/\nfunction ratioArray( X ) {\n\tvar R;\n\tvar i;\n\n\tR = [];\n\tfor ( i = 0; i < X.length-1; i++ ) {\n\t\tR.push( X[ i+1 ] / X[ i ] );\n\t}\n\treturn R;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ratioArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Transforms the tail of the normal distribution to the unit interval and then uses rejection technique to generate standard normal variable.\n*\n* ## References\n*\n* - Marsaglia, George. 1964. \"Generating a Variable from the Tail of the Normal Distribution.\" _Technometrics_ 6 (1): 101\u20132. doi:[10.1080/00401706.1964.10490150](http://dx.doi.org/10.1080/00401706.1964.10490150).\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} rTail - start value of the right tail\n* @param {boolean} isNegative - boolean indicating which side to evaluate\n* @returns {number} standard normal variable\n*/\nfunction sampleTail( rand, rTail, isNegative ) {\n\tvar x;\n\tvar y;\n\tdo {\n\t\tx = ln( rand() ) / rTail;\n\t\ty = ln( rand() );\n\t} while ( -2.0*y < x*x );\n\treturn ( isNegative ) ? x-rTail : rTail-x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sampleTail;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar coordsArray = require( './coords_array.js' );\nvar ratioArray = require( './ratio_array.js' );\nvar sampleTail = require( './sample_tail.js' );\n\n\n// VARIABLES //\n\n// Number of blocks:\nvar NUM_BLOCKS = 128;\n\n// Start of right tail (R):\nvar START_RIGHT_TAIL = 3.442619855899;\n\n// `X` holds coordinates, such that each rectangle has same area:\nvar X = coordsArray( NUM_BLOCKS, START_RIGHT_TAIL );\n\n// `R` holds `X[ i+1 ] / X[ i ]`:\nvar R = ratioArray( X );\n\n// 127 => 0x7F => 00000000000000000000000001111111\nvar LAST_7_BITS_MASK = 127|0; // asm type annotation\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the improved Ziggurat algorithm for generating normally distributed pseudorandom numbers.\n*\n* @private\n* @param {PRNG} randu - PRNG for generating uniformly distributed numbers\n* @param {PRNG} randi - PRNG for generating uniformly distributed integers\n* @returns {number} pseudorandom number\n*/\nfunction wrap( randu, randi ) {\n\treturn randn;\n\n\t/**\n\t* Generates a normally distributed pseudorandom number.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = randn();\n\t* // returns \n\t*/\n\tfunction randn() {\n\t\tvar f0;\n\t\tvar f1;\n\t\tvar x2;\n\t\tvar x;\n\t\tvar u;\n\t\tvar i;\n\t\tvar j;\n\t\twhile ( true ) {\n\t\t\tu = ( 2.0*randu() ) - 1.0;\n\t\t\ti = randi() & LAST_7_BITS_MASK;\n\n\t\t\t// First try the rectangular boxes...\n\t\t\tif ( abs( u ) < R[ i ] ) {\n\t\t\t\treturn u * X[ i ];\n\t\t\t}\n\t\t\t// If bottom box, sample from the tail...\n\t\t\tif ( i === 0 ) {\n\t\t\t\treturn sampleTail( randu, START_RIGHT_TAIL, u < 0.0 );\n\t\t\t}\n\t\t\t// Is this a sample from the wedges?\n\t\t\tx = u * X[ i ];\n\t\t\tx2 = x * x;\n\t\t\tj = i + 1;\n\t\t\tf0 = exp( -0.5 * ( (X[ i ]*X[ i ]) - x2 ) );\n\t\t\tf1 = exp( -0.5 * ( (X[ j ]*X[ j ]) - x2 ) );\n\t\t\tif ( f1 + (randu()*(f0-f1)) < 1.0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar improvedZiggurat = require( './improved_ziggurat.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the improved Ziggurat method to generate normally distributed pseudorandom numbers.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var r = randn();\n* // returns \n*\n* @example\n* // Return a seeded PRNG:\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar randu;\n\tvar randi;\n\tvar randn;\n\tvar opts;\n\n\topts = {\n\t\t'copy': true\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\t\tif ( !isFunction( options.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', options.prng ) );\n\t\t\t}\n\t\t\trandu = options.prng;\n\t\t}\n\t\t// If provided a PRNG, ignore the `state` option, as we don't support getting or setting PRNG state.\n\t\telse if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( !isUint32Array( options.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', options.state ) );\n\t\t\t}\n\t\t}\n\t\t// If provided a PRNG, ignore the `seed` option, as a `seed`, by itself, is insufficient to guarantee reproducibility. If provided a state, ignore the `seed` option, as a PRNG state should contain seed information.\n\t\telse if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( options.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', options.seed ) );\n\t\t\t}\n\t\t}\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( randu === void 0 ) {\n\t\t\trandi = mt19937( opts );\n\t\t\trandu = randi.normalized;\n\t\t} else {\n\t\t\trandi = mt19937({\n\t\t\t\t'seed': floor( 1.0 + ( UINT32_MAX*randu() ) ), // allows seeding via an externally seeded PRNG\n\t\t\t\t'copy': opts.copy\n\t\t\t});\n\t\t\topts.seed = null;\n\t\t}\n\t} else {\n\t\trandi = mt19937( opts );\n\t\trandu = randi.normalized;\n\t}\n\trandn = improvedZiggurat( randu, randi );\n\n\tsetReadOnly( randn, 'NAME', 'improved-ziggurat' );\n\tif ( opts.seed === null ) {\n\t\tsetReadOnly( randn, 'seed', null );\n\t\tsetReadOnly( randn, 'seedLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( randn, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( randn, 'seedLength', getSeedLength );\n\t}\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( options && options.prng ) {\n\t\tsetReadWriteAccessor( randn, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( randn, 'stateLength', null );\n\t\tsetReadOnly( randn, 'byteLength', null );\n\t\tsetReadOnly( randn, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadWriteAccessor( randn, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( randn, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( randn, 'byteLength', getStateSize );\n\t\tsetReadOnly( randn, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( randn, 'PRNG', randu );\n\n\treturn randn;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn randi.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn randi.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn randi.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn randi.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn randi.state;\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trandi.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = randn.NAME;\n\t\tout.state = typedarray2json( randi.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a standard normally distributed random number.\n*\n* ## Method\n*\n* The basic Ziggurat method works as follows:\n*\n* ```tex\n* x_{C-1}(r) \\left[ f(0) - f\\left( x_{C-1}(r) \\right) \\right] - V(r) = 0\n* ```\n*\n* where\n*\n* ```tex\n* V(r) = r \\; f(r) + \\int_r^\\infty \\; f(x) \\; dx\n* ```\n*\n* and \\\\( r \\\\) denotes the right-most \\\\( x_1 \\\\).\n*\n* - We then use the following rejection algorithm:\n*\n* - Draw a box \\\\( B_i \\\\) at random with probability \\\\( \\tfrac{1}{C} \\\\).\n* - Draw a random number from the box as \\\\( z = U_0 x_i \\\\) for \\\\( i > 0 \\\\) and \\\\( z = U_0 V / f(x_1) \\\\).\n* - If \\\\( z < x_{i+1} \\\\), accept \\\\( z \\\\).\n* - If \\\\( i = 0 \\\\), accept a \\\\( v \\\\) by transforming the tail of the normal distribution to the unit interval and then use rejection technique by Marsaglia, G. (1964) to generate a standard normal variable. Otherwise, if \\\\( i > 0 \\\\) and \\\\( U_1 \\left[ f(x_i) - f(x_{i+1})\\right] < f(z) - f(x_{i+1}) \\\\) accept \\\\( z \\\\).\n* - Go back to the first step.\n*\n* - The improved version by Doornik (2005) changes step four in order to correct a deficiency of the original Ziggurat algorithm. The updated version requires the generation of two random numbers, a uniform variable drawn from \\\\( U(-1,1) \\\\) and the last seven bits of a random integer.\n*\n* ## References\n*\n* - Doornik, Jurgen A. 2005. \"An Improved Ziggurat Method to Generate Normal Random Samples.\" .\n* - Marsaglia, George, and Wai Wan Tsang. 2000. \"The Ziggurat Method for Generating Random Variables.\" _Journal of Statistical Software_ 5 (1): 1\u20137. doi:[10.18637/jss.v005.i08](http://dx.doi.org/10.18637/jss.v005.i08).\n* - Marsaglia, George. 1964. \"Generating a Variable from the Tail of the Normal Distribution.\" _Technometrics_ 6 (1): 101\u20132. doi:[10.1080/00401706.1964.10490150](http://dx.doi.org/10.1080/00401706.1964.10490150).\n*\n* @name randn\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var r = randn();\n* // returns \n*/\nvar randn = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Normally distributed pseudorandom numbers using the improved Ziggurat method.\n*\n* @module @stdlib/random/base/improved-ziggurat\n*\n* @example\n* var randn = require( '@stdlib/random/base/improved-ziggurat' );\n*\n* var r = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/improved-ziggurat' ).factory;\n*\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// VARIABLES //\n\nvar ONE_THIRD = 1.0 / 3.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution with rate parameter equal to 1.0 and shape parameter equal to `alpha`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction standardGamma( randu, randn, alpha ) {\n\tvar flg;\n\tvar x2;\n\tvar v0;\n\tvar v1;\n\tvar c;\n\tvar d;\n\tvar x;\n\tvar s;\n\tvar u;\n\tvar v;\n\n\tif ( alpha < 1.0 ) {\n\t\td = alpha + 1.0 - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\ts = pow( randu(), 1.0/alpha );\n\t} else {\n\t\td = alpha - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\ts = 1.0;\n\t}\n\tflg = true;\n\twhile ( flg ) {\n\t\tdo {\n\t\t\tx = randn();\n\t\t\tv = 1.0 + (c*x);\n\t\t} while ( v <= 0.0 );\n\t\tv *= v * v;\n\t\tx2 = x * x;\n\t\tv0 = 1.0 - (0.331*x2*x2);\n\t\tv1 = (0.5*x2) + (d*( 1.0-v+ln(v) ));\n\t\tu = randu();\n\t\tif ( u < v0 || ln( u ) < v1 ) {\n\t\t\tflg = false;\n\t\t}\n\t}\n\treturn d * v * s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = standardGamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles case where `alpha` and `beta` are equal and greater than `1.5`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha ) {\n\tvar flg;\n\tvar s4;\n\tvar A;\n\tvar s;\n\tvar t;\n\tvar u;\n\tvar x;\n\tvar y;\n\n\tA = alpha - 1.0;\n\tt = pow( A+A, 0.5 );\n\n\tflg = true;\n\twhile ( flg === true ) {\n\t\ts = randn();\n\t\tx = 0.5 * ( 1.0+(s/t) );\n\t\tif ( x >= 0.0 && x <= 1.0 ) {\n\t\t\tu = randu();\n\t\t\ts4 = pow( s, 4.0 );\n\t\t\ty = (8.0*alpha) - 12.0;\n\t\t\ty = 1.0 - (s4 / y);\n\t\t\tif ( u <= y ) {\n\t\t\t\tflg = false;\n\t\t\t} else {\n\t\t\t\ty += 0.5 * pow( s4/((8.0*alpha)-8.0), 2.0 );\n\t\t\t\tif ( u < y ) {\n\t\t\t\t\ty = A * ln( 4.0*x*(1.0-x) );\n\t\t\t\t\ty += s*s / 2.0;\n\t\t\t\t\tif ( y >= ln( u ) ) {\n\t\t\t\t\t\tflg = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles case where both `alpha` and `beta` are greater than `1.0`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha, beta ) {\n\tvar sigma;\n\tvar flg;\n\tvar mu;\n\tvar A;\n\tvar B;\n\tvar C;\n\tvar L;\n\tvar s;\n\tvar u;\n\tvar x;\n\tvar y;\n\n\tA = alpha - 1.0;\n\tB = beta - 1.0;\n\tC = A + B;\n\tL = C * ln( C );\n\tmu = A / C;\n\tsigma = 0.5 / pow( C, 0.5 );\n\n\tflg = true;\n\twhile ( flg === true ) {\n\t\ts = randn();\n\t\tx = mu + (s*sigma);\n\t\tif ( x >= 0.0 && x <= 1.0 ) {\n\t\t\tu = randu();\n\t\t\ty = A * ln( x/A );\n\t\t\ty += B * ln((1.0-x) / B);\n\t\t\ty += L + (0.5*s*s);\n\t\t\tif ( y >= ln( u ) ) {\n\t\t\t\tflg = false;\n\t\t\t}\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles general case.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( rand, alpha, beta ) {\n\tvar lx;\n\tvar ly;\n\tvar xy;\n\tvar u;\n\tvar v;\n\tvar x;\n\tvar y;\n\twhile ( true ) {\n\t\tu = rand();\n\t\tv = rand();\n\t\tx = pow( u, 1.0/alpha );\n\t\ty = pow( v, 1.0/beta );\n\t\txy = x + y;\n\t\tif ( xy <= 1.0 ) {\n\t\t\tif ( xy > 0.0 ) {\n\t\t\t\treturn x / ( xy );\n\t\t\t}\n\t\t\tlx = ln( u ) / alpha;\n\t\t\tly = ln( v ) / beta;\n\t\t\tif ( lx > ly ) {\n\t\t\t\tly -= lx;\n\t\t\t\tlx = 0.0;\n\t\t\t} else {\n\t\t\t\tlx -= ly;\n\t\t\t\tly = 0.0;\n\t\t\t}\n\t\t\treturn exp( lx - ln( exp(lx) + exp(ly) ) );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar standardGamma = require( './standard_gamma.js' );\nvar sample1 = require( './sample1.js' );\nvar sample2 = require( './sample2.js' );\nvar sample3 = require( './sample3.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from a beta distribution.\n*\n* @private\n* @param {PRNG} randu - pseudorandom number generator for uniformly distributed numbers\n* @param {PRNG} randn - pseudorandom number generator for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha, beta ) {\n\tvar ga;\n\tvar gb;\n\tif ( alpha === beta && alpha > 1.5 ) {\n\t\treturn sample1( randu, randn, alpha );\n\t}\n\tif ( alpha > 1.0 && beta > 1.0 ) {\n\t\treturn sample2( randu, randn, alpha, beta );\n\t}\n\tif ( alpha < 1.0 && beta < 1.0 ) {\n\t\treturn sample3( randu, alpha, beta );\n\t}\n\t// General case of using two gamma random variates:\n\tga = standardGamma( randu, randn, alpha );\n\tgb = standardGamma( randu, randn, beta );\n\treturn ga / ( ga + gb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar beta0 = require( './beta.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating beta distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var beta = factory( 2.0, 1.0 );\n* var v = beta();\n* // returns \n*\n* @example\n* var beta = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = beta();\n* // returns \n*/\nfunction factory() {\n\tvar STATE;\n\tvar rnorm;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar FLG;\n\tvar err;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trand = randu( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trand = randu( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\trnorm = randn({\n\t\t\t'prng': opts.prng\n\t\t});\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rand.state;\n\t\t\trand.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\trnorm = randn({\n\t\t\t'state': STATE,\n\t\t\t'copy': false\n\t\t});\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = beta2;\n\t} else {\n\t\tprng = beta1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'beta' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta1();\n\t* // returns \n\t*/\n\tfunction beta1() {\n\t\treturn beta0( rand, rnorm, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction beta2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn beta0( rand, rnorm, alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a beta distributed random number.\n*\n* ## References\n*\n* - Ahrens, J.H., and U. Dieter. 1974. \"Computer methods for sampling from gamma, beta, poisson and bionomial distributions.\" _Computing_ 12 (3): 223\u201346. doi:[10.1007/BF02293108](http://dx.doi.org/10.1007/BF02293108).\n* - J\u00F6hnk, M.D. 1964. \"Erzeugung von Betaverteilten Und Gammaverteilten Zufallszahlen.\" _Metrika_ 8: 5\u201315. .\n*\n* @name beta\n* @type {PRNG}\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*\n* @example\n* var r = beta( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = beta( -2.0, 5.0 );\n* // returns NaN\n*/\nvar beta = factory();\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Beta distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/beta\n*\n* @example\n* var beta = require( '@stdlib/random/base/beta' );\n*\n* var v = beta( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/beta' ).factory;\n*\n* var beta = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = beta();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/beta' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var beta = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = beta( 10 );\n* // returns \n*\n* @example\n* var beta = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = beta( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = beta2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = beta2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = beta1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = beta1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a beta distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction beta1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a beta distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction beta2( len, alpha, beta, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ alpha ], [ beta ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( alpha, beta );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a beta distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n*\n* @name beta\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = beta( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = beta( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar beta = factory();\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a beta distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n*\n* @module @stdlib/random/array/beta\n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var arr = beta( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var arr = beta( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var rand = beta.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var rand = beta.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {PositiveNumber} beta - rate parameter\n* @param {PositiveNumber} d - `alpha + 2/3` or `alpha - 1/3`\n* @param {PositiveNumber} c - `1.0 / sqrt( 9.0*d )`\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction gamma( randu, randn, beta, d, c ) {\n\tvar flg;\n\tvar x2;\n\tvar v0;\n\tvar v1;\n\tvar x;\n\tvar u;\n\tvar v;\n\n\tflg = true;\n\twhile ( flg ) {\n\t\tdo {\n\t\t\tx = randn();\n\t\t\tv = 1.0 + (c*x);\n\t\t} while ( v <= 0.0 );\n\t\tv *= v * v;\n\t\tx2 = x * x;\n\t\tv0 = 1.0 - (0.331*x2*x2);\n\t\tv1 = (0.5*x2) + (d*( 1.0-v+ln(v) ));\n\t\tu = randu();\n\t\tif ( u < v0 || ln( u ) < v1 ) {\n\t\t\tflg = false;\n\t\t}\n\t}\n\treturn (1.0/beta) * d * v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar gamma0 = require( './gamma.js' );\n\n\n// VARIABLES //\n\nvar ONE_THIRD = 1.0 / 3.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating gamma distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var gamma = factory( 2.0, 1.0 );\n* var v = gamma();\n* // returns \n*\n* @example\n* var gamma = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = gamma();\n* // returns \n*/\nfunction factory() {\n\tvar STATE;\n\tvar alpha;\n\tvar rnorm;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar FLG;\n\tvar err;\n\tvar c;\n\tvar d;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trand = randu( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trand = randu( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\trnorm = randn({\n\t\t\t'prng': opts.prng\n\t\t});\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rand.state;\n\t\t\trand.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\trnorm = randn({\n\t\t\t'state': STATE,\n\t\t\t'copy': false\n\t\t});\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = gamma2;\n\t} else {\n\t\tif ( alpha >= 1.0 ) {\n\t\t\tprng = gamma1a;\n\t\t\td = alpha - ONE_THIRD;\n\t\t} else {\n\t\t\tprng = gamma1b;\n\t\t\td = alpha + 1.0 - ONE_THIRD;\n\t\t}\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t}\n\tsetReadOnly( prng, 'NAME', 'gamma' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution with bound parameters when `alpha >= 1`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma1a();\n\t* // returns \n\t*/\n\tfunction gamma1a() {\n\t\treturn gamma0( rand, rnorm, beta, d, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution with bound parameters when `alpha < 1`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma1b();\n\t* // returns \n\t*/\n\tfunction gamma1b() {\n\t\treturn gamma0( rand, rnorm, beta, d, c ) * pow( rand(), 1.0/alpha );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma2( 2.0, 4.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = gamma2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = gamma2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = gamma2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction gamma2( alpha, beta ) {\n\t\tvar c;\n\t\tvar d;\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\tif ( alpha < 1.0 ) {\n\t\t\td = alpha + 1.0 - ONE_THIRD;\n\t\t\tc = 1.0 / sqrt( 9.0*d );\n\t\t\treturn gamma0( rand, rnorm, beta, d, c ) * pow( rand(), 1.0/alpha );\n\t\t}\n\t\td = alpha - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\treturn gamma0( rand, rnorm, beta, d, c );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution.\n*\n* ## References\n*\n* - Marsaglia, George, and Wai Wan Tsang. 2000. \"A Simple Method for Generating Gamma Variables.\" _ACM Transactions on Mathematical Software_ 26 (3). New York, NY, USA: ACM: 363\u201372. doi:[10.1145/358407.358414](http://dx.doi.org/10.1145/358407.358414).\n*\n* @name gamma\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var v = gamma( 2.0, 4.0 );\n* // returns \n*\n* @example\n* var v = gamma( -2.0, 4.0 );\n* // returns NaN\n*/\nvar gamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Gamma distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/gamma\n*\n* @example\n* var gamma = require( '@stdlib/random/base/gamma' );\n*\n* var v = gamma( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gamma' ).factory;\n*\n* var gamma = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = gamma();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a random number drawn from a beta prime distribution.\n*\n* @private\n* @param {PRNG} rgamma - pseudorandom number generator for gamma distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction sample( rgamma, alpha, beta ) {\n\treturn rgamma( alpha, 1.0 ) / rgamma( beta, 1.0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar gammaFactory = require( './../../../base/gamma' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar betaprime0 = require( './betaprime.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating beta prime distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var betaprime = factory( 2.0, 1.0 );\n* var v = betaprime();\n* // returns \n*\n* @example\n* var betaprime = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = betaprime();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gammaFactory();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\trgamma = gammaFactory( opts );\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\trgamma = gammaFactory( opts );\n\t\t} else {\n\t\t\trgamma = gammaFactory();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = betaprime2;\n\t} else {\n\t\tprng = betaprime1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'betaprime' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta prime distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = betaprime1();\n\t* // returns \n\t*/\n\tfunction betaprime1() {\n\t\treturn betaprime0( rgamma, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = betaprime2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction betaprime2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn betaprime0( rgamma, alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a beta prime distributed random number.\n*\n* @name betaprime\n* @type {PRNG}\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var r = betaprime( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = betaprime( -2.0, 5.0 );\n* // returns NaN\n*/\nvar betaprime = factory();\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Beta prime distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/betaprime\n*\n* @example\n* var betaprime = require( '@stdlib/random/base/betaprime' );\n*\n* var v = betaprime( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/betaprime' ).factory;\n*\n* var betaprime = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = betaprime();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/betaprime' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var betaprime = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = betaprime( 10 );\n* // returns \n*\n* @example\n* var betaprime = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = betaprime( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = betaprime2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = betaprime2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = betaprime1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = betaprime1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a beta prime distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction betaprime1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a beta prime distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction betaprime2( len, alpha, beta, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ alpha ], [ beta ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( alpha, beta );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a beta prime distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n*\n* @name beta\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = betaprime( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = betaprime( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar betaprime = factory();\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a beta prime distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter).\n*\n* @module @stdlib/random/array/betaprime\n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var arr = betaprime( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var arr = betaprime( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var rand = betaprime.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var rand = betaprime.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, s ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar quantile = require( '@stdlib/stats/base/dists/cosine/quantile' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a raised cosine distribution using inverse transform sampling.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction sample( rand, mu, s ) {\n\treturn quantile( rand(), mu, s );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar cosine0 = require( './cosine.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a raised cosine distribution.\n*\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var cosine = factory( 0.0, 1.0 );\n* var v = cosine();\n* // returns \n*\n* @example\n* var cosine = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = cosine();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar s;\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\terr = validate( mu, s );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = cosine2;\n\t} else {\n\t\tprng = cosine1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'cosine' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, s ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a raised cosine distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cosine1();\n\t* // returns \n\t*/\n\tfunction cosine1() {\n\t\treturn cosine0( rand, mu, s );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cosine2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = cosine2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction cosine2( mu, s ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( s ) ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn cosine0( rand, mu, s );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a raised cosine distribution.\n*\n* @name cosine\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = cosine( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = cosine( 0.0, -1.0 );\n* // returns NaN\n*/\nvar cosine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Raised cosine distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/cosine\n*\n* @example\n* var cosine = require( '@stdlib/random/base/cosine' );\n*\n* var v = cosine( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cosine' ).factory;\n* var cosine = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = cosine();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cosine' ).factory;\n* var cosine = factory({\n* 'seed': 297\n* });\n*\n* var v = cosine( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/cosine' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var cosine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cosine( 10 );\n* // returns \n*\n* @example\n* var cosine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cosine( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = cosine2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = cosine2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = cosine1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = cosine1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a raised cosine distribution with parameters `mu` (mean) and `s` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction cosine1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a raised cosine distribution with parameters `mu` (mean) and `s` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction cosine2( len, mu, s, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ mu ], [ s ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( mu, s );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a raised cosine distribution with parameters `mu` (mean) and `s` (scale parameter).\n*\n* @name cosine\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = cosine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = cosine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar cosine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a raised cosine distribution with parameters `mu` (mean) and `s` (scale parameter).\n*\n* @module @stdlib/random/array/cosine\n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var arr = cosine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var arr = cosine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var rand = cosine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var rand = cosine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 20 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isInteger( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be an integer and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be an integer and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The original C++ code and copyright notice are from the [Boost library]{http://www.boost.org/doc/libs/1_65_1/doc/html/boost/random/uniform_int_distribution.html}. The implementation has been modified for JavaScript.\n*\n* ```text\n* (C) Copyright John Maddock 2006.\n* (C) Copyright Steven Watanabe 2011.\n*\n* Use, modification and distribution are subject to the\n* Boost Software License, Version 1.0. (See accompanying file\n* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator which outputs integer values\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {integer} pseudorandom number\n*/\nfunction discreteUniform( rand, a, b ) {\n\tvar result;\n\tvar RANGE;\n\tvar range;\n\tvar limit;\n\tvar bsize;\n\tvar mult;\n\tvar MIN;\n\tvar MAX;\n\tvar inc;\n\n\trange = b - a;\n\tif ( range === 0 ) {\n\t\treturn a;\n\t}\n\tMIN = rand.MIN;\n\tMAX = rand.MAX;\n\tRANGE = MAX - MIN;\n\tif ( RANGE === range ) {\n\t\treturn ( rand()-MIN ) + a;\n\t}\n\tif ( RANGE < range ) {\n\t\tlimit = 0;\n\t\twhile ( true ) {\n\t\t\t// Avoid overflow...\n\t\t\tif ( range === MAX_SAFE_INTEGER ) { // in JavaScript, we only explicitly have doubles\n\t\t\t\tlimit = floor( range / (RANGE+1) );\n\t\t\t\tif ( range%(RANGE+1) === RANGE ) { // e.g., 5%(2+1) == 2\n\t\t\t\t\tlimit += 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlimit = floor( (range+1) / (RANGE+1) );\n\t\t\t}\n\t\t\t// We consider `result` as expressed base `(RANGE+1)`:\n\t\t\tresult = 0;\n\n\t\t\t// For every power of `(RANGE+1)`, we determine a random factor:\n\t\t\tmult = 1;\n\n\t\t\t// Loop invariants: result < mult && mult <= range\n\t\t\twhile ( mult <= limit ) {\n\t\t\t\t// Note: see first and second post-conditions.\n\t\t\t\tresult += (rand() - MIN) * mult;\n\n\t\t\t\t// Equivalent to (mult * (RANGE+1)) == range+1, but avoids overflow...\n\t\t\t\tif ( mult*RANGE === range-mult+1 ) {\n\t\t\t\t\t// The destination range is an integer power of the generator's range...\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\t// Note: see third post-condition.\n\t\t\t\tmult *= RANGE + 1;\n\t\t\t}\n\t\t\t// range/mult < RANGE+1 (no endless loop)\n\t\t\tinc = discreteUniform( rand, 0, floor( range/mult ) );\n\t\t\tif ( inc > MAX_SAFE_INTEGER/mult ) {\n\t\t\t\t// The multiplication would overflow, so reject immediately...\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tinc *= mult;\n\t\t\tresult += inc;\n\n\t\t\t// NOTE: if we were working with unsigned integers, we would need to check that `result` is NOT less than `inc`, as unsigned integers wrap on overflow. In which case, we would need to reject.\n\n\t\t\tif ( result > range ) {\n\t\t\t\t// Result is too big, so reject...\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn result + a;\n\t\t}\n\t}\n\t// Case: RANGE > range\n\n\t// When determining the bucket size, avoid overflow...\n\tif ( RANGE === MAX_SAFE_INTEGER ) { // in JavaScript, we only explicitly have doubles\n\t\tbsize = floor( RANGE / (range+1) );\n\t\tif ( RANGE%(range+1) === range ) { // e.g., 5%(2+1) == 2\n\t\t\tbsize += 1;\n\t\t}\n\t} else {\n\t\tbsize = floor( (RANGE+1) / (range+1) );\n\t}\n\twhile ( true ) {\n\t\tresult = rand() - MIN;\n\t\tresult = floor( result / bsize );\n\t\tif ( result <= range ) {\n\t\t\treturn result + a;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randi = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar discreteUniform0 = require( './discrete_uniform.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers draw from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom integers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} provided PRNG must have a valid `MIN` property\n* @throws {TypeError} provided PRNG must have a valid `MAX` property\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var discreteUniform = factory( 1, 10 );\n* var v = discreteUniform();\n* // returns \n*\n* @example\n* var discreteUniform = factory( -30, -1, {\n* 'seed': 297\n* });\n* var v = discreteUniform();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randi();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t\tif ( !isInteger( rand.MIN ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t}\n\t\t\tif ( !isInteger( rand.MAX ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randi( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t\tif ( !isInteger( rand.MIN ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t\t}\n\t\t\t\tif ( !isInteger( rand.MAX ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trand = randi( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randi();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = discreteUniform2;\n\t} else {\n\t\tprng = discreteUniform1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'discrete-uniform' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = discreteUniform1();\n\t* // returns \n\t*/\n\tfunction discreteUniform1() {\n\t\treturn discreteUniform0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {integer} a - minimum support\n\t* @param {integer} b - maximum support\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = discreteUniform2( 1, 10 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = discreteUniform2( 1, 0 );\n\t* // returns NaN\n\t*/\n\tfunction discreteUniform2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\t!isInteger( a ) ||\n\t\t\t!isInteger( b ) ||\n\t\t\ta > b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn discreteUniform0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* ## Method\n*\n* - Let \\\\( R \\\\) be a pseudorandom generator (PRNG) which yields integers on the interval \\\\( \\[ A, B ] \\\\).\n*\n* - If \\\\( a = b \\\\), then \\\\( rv = a \\\\).\n*\n* - Let \\\\( r1 = b - a \\\\) and \\\\( r2 = B - A \\\\). If \\\\( r2 = r1 \\\\) (likely a rare occurrence), then\n*\n* ```tex\n* rv = ( R() - B ) + a\n* ```\n*\n* where, for real integer types, operation order is important in order to avoid overflow.\n*\n* - If \\\\( r2 < r1 \\\\), use rejection sampling to map random variates from \\\\( R \\\\) to a larger domain (e.g., \\\\( {0,1,2,3} \\rightarrow {0,1,2,3,4} \\\\)). For real integer types (and floating-point integer values), we must take extra care to avoid overflow. During sampling, the following conditions will hold:\n*\n* - First, consider the post-condition: \\\\( \\textrm{result} \\leq r2 \\\\), thus avoiding overflow.\n*\n* - Begin with definition of \\\\( \\textrm{limit} \\\\)\n*\n* ```tex\n* \\textrm{limit} = \\lfloor{\\frac{r2+1}{r1+1}\\rfloor\n* ```\n*\n* thus,\n*\n* ```tex\n* \\textrm{limit}\\ \\cdot (r1+1) \\leq r2+1\n* ```\n*\n* - Let \\\\( m \\\\) be a random factor where the loop condition is defined as\n*\n* ```tex\n* m \\leq \\textrm{limit}\n* ```\n*\n* - Let \\\\( \\textrm{result} \\\\) be the generator output, which is expressed base \\\\( r2+1 \\\\) and obeys the loop invariant \\\\( \\textrm{result} < m \\\\).\n*\n* - Let \\\\( rv \\\\) be a realization of the PRNG. Then,\n*\n* ```tex\n* rv-A \\leq r1\n* ```\n*\n* and, by the loop condition, \\\\( m \\leq \\textrm{limit} \\\\).\n*\n* - Therefore,\n*\n* ```tex\n* m \\cdot (rv - A + 1) \\leq r2+1\n* ```\n*\n* - Rearranging terms,\n*\n* ```tex\n* m + m \\cdot (rv - A) \\leq r2+1\n* ```\n*\n* - Since \\\\( \\textrm{result} < m \\\\),\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < r2+1\n* ```\n*\n* - Next, consider the post-condition: \\\\( \\textrm{result} < m \\cdot (r2+1) \\\\).\n*\n* - Since \\\\( \\textrm{result} < m \\\\) and \\\\( rv - A \\leq r1 \\\\),\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m + m \\cdot (rv - A)\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m + m \\cdot r1\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m \\cdot (r1+1)\n* ```\n*\n* - Next, consider the post-condition: \\\\( m \\leq r2 \\\\).\n*\n* - According to the definition of \\\\( \\textrm{limit} \\\\) and the loop condition \\\\( m \\leq \\textrm{limit} \\\\),\n*\n* ```tex\n* m \\cdot (r1+1) \\leq r2+1\n* ```\n*\n* - If \\\\( r2 \\\\) is **not** an integer power of the generator range \\\\( r1 \\\\), i.e.,\n*\n* ```tex\n* m \\cdot (r1+1) \\neq r2+1\n* ```\n*\n* then\n*\n* ```tex\n* m \\cdot (r1+1) < r2+1\n* ```\n*\n* - Thus, \\\\( \\textrm{result} < m \\\\).\n*\n* - Next, consider the post-condition: \\\\( r2/m < r1+1 \\\\).\n*\n* - To show this is true, let us try to prove its opposite. Given the loop condition \\\\( m > \\textrm{limit} \\\\), assume\n*\n* ```tex\n* r2/m > r1+1\n* ```\n*\n* - Accordingly,\n*\n* ```tex\n* r2 \\geq m \\cdot (r1+1)\n* ```\n*\n* - Hence,\n*\n* ```tex\n* r2+1 > m \\cdot (r1+1)\n* ```\n*\n* - Using the loop condition,\n*\n* ```tex\n* r2+1 > (\\textrm{limit}+1) \\cdot (r1+1)\n* ```\n*\n* - Rearranging terms,\n*\n* ```tex\n* \\frac{r2+1}{r1+1} > \\textrm{limit} + 1\n* ```\n*\n* - Hence,\n*\n* ```tex\n* \\textrm{limit} < \\lfloor{\\frac{r2+1}{r1+1}} \\rfloor\n* ```\n*\n* - But the definition of \\\\( \\textrm{limit} \\\\) is\n*\n* ```tex\n* \\textrm{limit} = \\lfloor{\\frac{r2+1}{r1+1}}\n* ```\n*\n* - Thus, our assumption cannot be true, providing the post-condition by reductio ad absurdum.\n*\n* - Next, consider the post-condition\n*\n* ```tex\n* r2 \\leq \\frac{r2}{m} \\cdot m + (m - 1)\n* ```\n*\n* - Recall the identity\n*\n* ```tex\n* r2 = \\frac{r2}{m} \\cdot m + r2 \\mod m\n* ```\n*\n* - By the definition of the modulus\n*\n* ```tex\n* r2 \\mod m < m\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* r2 < \\frac{r2}{m} \\cdot m + m\n* ```\n*\n* - Hence,\n*\n* ```tex\n* r2 \\leq \\frac{r2}{m} \\cdot m + (m - 1)\n* ```\n*\n* At this point, the maximum value \\\\( \\textrm{result} \\\\) is \\\\( m-1 \\\\). Hence, we can generate numbers that can be at least as large as \\\\( r2 \\\\), but we must be careful to avoid overflow during addition and in the sampling rejection. Anything which overflows is larger than \\\\( r2 \\\\) and can thus be rejected.\n*\n* - If \\\\( r1 > r2 \\\\), use rejection sampling to map random variates from \\\\( R \\\\) to a smaller domain (e.g., \\\\( {0,1,2,3,4} \\rightarrow {0,1,2,3} \\\\)) by defining \"buckets\" in which multiple random variates in \\\\( R \\\\) map to a single random variate in the smaller domain. We are safe in adding 1 to \\\\( r2 \\\\); however, we need to be careful to not cause overflow when adding 1 to \\\\( r1 \\\\).\n*\n* @name discreteUniform\n* @type {PRNG}\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {integer} pseudorandom number\n*\n* @example\n* var v = discreteUniform( 1, 10 );\n* // returns \n*/\nvar discreteUniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Discrete uniform distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/discrete-uniform\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );\n*\n* var v = discreteUniform( 1, 10 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/discrete-uniform' ).factory;\n* var discreteUniform = factory( -5, 5, {\n* 'seed': 297\n* });\n*\n* var v = discreteUniform();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/discrete-uniform' ).factory;\n* var discreteUniform = factory({\n* 'seed': 297\n* });\n*\n* var v = discreteUniform( -5, 5 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/discrete-uniform' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var uniform = factory( -10, 10 );\n* // returns \n*\n* var arr = uniform( 10 );\n* // returns \n*\n* @example\n* var uniform = factory( -10, 10 );\n* // returns \n*\n* var arr = uniform( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = uniform2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = uniform2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = uniform1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = uniform1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction uniform1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction uniform2( len, a, b, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ a ], [ b ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( a, b );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @name discreteUniform\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = discreteUniform( 10, -10, 10 );\n* // returns \n*\n* @example\n* var arr = discreteUniform( 10, -10, 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar discreteUniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @module @stdlib/random/array/discrete-uniform\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var arr = discreteUniform( 10, -10, 10 );\n* // returns \n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var arr = discreteUniform( 10, -10, 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var rand = discreteUniform.factory( -10, 10 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var rand = discreteUniform.factory( -10, 10 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar unary = require( '@stdlib/strided/base/unary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG.\n*\n* @constructor\n* @param {Function} prng - unary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a unary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {*} param1 - PRNG parameter\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, param1, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar prng;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tprng = this._prng;\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, wrapper );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tunary( [ [ param1 ], out ], [ len ], [ 0, 1 ], prng );\n\treturn out;\n\n\t/**\n\t* Applies parameters to a pseudorandom value generator function.\n\t*\n\t* @private\n\t* @returns {*} pseudorandom value\n\t*/\n\tfunction wrapper() {\n\t\treturn prng( param1 );\n\t}\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a unary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {*} param1 - PRNG parameter\n* @param {Collection} out - output array\n* @throws {TypeError} second argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( 2.0, out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( param1, out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when filling small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tunary( [ [ param1 ], out ], [ out.length ], [ 0, 1 ], this._prng );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG.\n*\n* @module @stdlib/random/array/tools/unary\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var Random = require( '@stdlib/random/array/tools/unary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @constructor\n* @param {Function} prng - nullary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, this._prng );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tnullary( [ out ], [ len ], [ 1 ], this._prng );\n\treturn out;\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a nullary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {Collection} out - output array\n* @throws {TypeError} first argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\tnullary( [ out ], [ out.length ], [ 1 ], this._prng );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @module @stdlib/random/array/tools/nullary\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var Random = require( '@stdlib/random/array/tools/nullary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar UnaryRandom = require( './../../../../array/tools/unary' );\nvar NullaryRandom = require( './../../../../array/tools/nullary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for generating pseudorandom values drawn from a unary PRNG.\n*\n* @param {Function} prng - unary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new unary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output array data types\n* @param {string} dtype - default output array data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported output array data type\n* @returns {Function} function which returns a function for creating arrays\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 0.2 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 0.2, {\n* 'dtype': 'float32'\n* });\n* // returns \n*/\nfunction createFactory( prng, dtypes, dtype ) {\n\tvar isValidDataType;\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tisValidDataType = contains( dtypes );\n\treturn factory;\n\n\t/**\n\t* Returns a function for generating pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {*} [param1] - PRNG parameter\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @param {string} [options.dtype] - default output array data type\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for creating arrays\n\t*/\n\tfunction factory() {\n\t\tvar Random;\n\t\tvar random;\n\t\tvar param1;\n\t\tvar assign;\n\t\tvar nargs;\n\t\tvar base;\n\t\tvar opts;\n\t\tvar rand;\n\t\tvar dt;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs < 1 ) { // e.g., factory()\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t\trand = rand1;\n\t\t} else if ( nargs > 1 ) { // e.g., factory( param1, {} )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\topts = arguments[ 1 ];\n\t\t\tbase = prng.factory( param1, opts );\n\t\t\trand = rand2;\n\t\t} else if ( isPlainObject( arguments[ 0 ] ) ) { // e.g., factory( {} )\n\t\t\topts = arguments[ 0 ];\n\t\t\tbase = prng.factory( opts );\n\t\t\trand = rand1;\n\t\t} else { // e.g., factory( param1 )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\topts = {};\n\t\t\tbase = prng.factory( param1 );\n\t\t\trand = rand2;\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t\tif ( !isValidDataType( dt ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), dt ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdt = dtype;\n\t\t}\n\t\tif ( rand === rand1 ) {\n\t\t\tassign = assign1;\n\t\t\tRandom = UnaryRandom;\n\t\t} else {\n\t\t\tassign = assign2;\n\t\t\tRandom = NullaryRandom;\n\t\t}\n\t\trandom = new Random( base, dtypes, dt );\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'assign', assign );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {*} param1 - PRNG parameter\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand1( len, param1, options ) {\n\t\t\tif ( arguments.length < 3 ) {\n\t\t\t\treturn random.generate( len, param1 );\n\t\t\t}\n\t\t\treturn random.generate( len, param1, options );\n\t\t}\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand2( len, options ) {\n\t\t\tif ( arguments.length < 2 ) {\n\t\t\t\treturn random.generate( len );\n\t\t\t}\n\t\t\treturn random.generate( len, options );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {*} param1 - PRNG parameter\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} second argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign1( param1, out ) {\n\t\t\treturn random.assign( param1, out );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} first argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign2( out ) {\n\t\t\treturn random.assign( out );\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a factory function for generating pseudorandom values drawn from a unary PRNG.\n*\n* @module @stdlib/random/array/tools/unary-factory\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var unaryFactory = require( '@stdlib/random/array/tools/unary-factory' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = unaryFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 0.2 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an exponential distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction exponential( rand, lambda ) {\n\treturn -ln( 1.0 - rand() ) / lambda;\n}\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar exponential0 = require( './exponential.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating exponentially distributed random numbers.\n*\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var exponential = factory( 0.5 );\n* var v = exponential();\n* // returns \n*\n* @example\n* var exponential = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = exponential();\n* // returns ~3.735\n*\n* @example\n* var exponential = factory();\n* var v = exponential( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tlambda = arguments[ 0 ];\n\t\tif ( !isPositive( lambda ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = exponential2;\n\t} else {\n\t\tprng = exponential1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'exponential' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( lambda === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an exponential distribution with bound parameter `lambda`.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = exponential1();\n\t* // returns \n\t*/\n\tfunction exponential1() {\n\t\treturn exponential0( rand, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an exponential distribution with parameter `lambda`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = exponential2( 4.8 );\n\t* // returns \n\t*/\n\tfunction exponential2( lambda ) {\n\t\tif (\n\t\t\tisnan( lambda ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn exponential0( rand, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an exponential distribution with parameter `lambda`.\n*\n* @name exponential\n* @type {PRNG}\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = exponential( 4.8 );\n* // returns \n*\n* @example\n* var v = exponential( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = exponential( NaN );\n* // returns NaN\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Exponentially distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/exponential\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var v = exponential( 4.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/exponential' ).factory;\n*\n* var exponential = factory( 4.0, {\n* 'seed': 297\n* });\n*\n* var v = exponential();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/exponential' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var exponential = factory( 2.0 );\n* // returns \n*\n* var arr = exponential( 10 );\n* // returns \n*\n* @example\n* var exponential = factory( 2.0 );\n* // returns \n*\n* var arr = exponential( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an exponential distribution with rate parameter `lambda`.\n*\n* @name exponential\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = exponential( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = exponential( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from an exponential distribution with rate parameter `lambda`.\n*\n* @module @stdlib/random/array/exponential\n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var arr = exponential( 10, 2.0 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var arr = exponential( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var rand = exponential.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var rand = exponential.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/gamma' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var gamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gamma( 10 );\n* // returns \n*\n* @example\n* var gamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gamma( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = gamma2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = gamma2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = gamma1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = gamma1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a gamma distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction gamma1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a gamma distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction gamma2( len, alpha, beta, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ alpha ], [ beta ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( alpha, beta );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a gamma distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter).\n*\n* @name gamma\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = gamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = gamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar gamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a gamma distribution with parameters `alpha` (shape parameter) and `beta` (rate parameter).\n*\n* @module @stdlib/random/array/gamma\n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var arr = gamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var arr = gamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var rand = gamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var rand = gamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a geometric distribution.\n*\n* ## Proof\n*\n* Consider\n*\n* ```tex\n* N = \\left \\lfloor \\ln (U) / \\ln (1-p) \\right \\rfloor\n* ```\n*\n* where \\\\( U \\\\) is uniform on the interval \\\\((0,1)\\\\). Accordingly, \\\\(N\\\\) must be a nonnegative integer, and, for every \\\\( n \\geq 0\\\\), the event \\\\(A_n = \\left \\{ N = n \\right \\}\\\\) is\n*\n* ```tex\n* A_n = \\left \\{(n+1) \\ln (1-p) < \\ln (U) \\leq n \\ln (1-p) \\right \\}\n* ```\n*\n* where \\\\(\\ln (1-p) < 0\\\\). Thus,\n*\n* ```tex\n* A_n = \\left \\{(1-p)^{n+1} < U \\leq (1-p)^n \\right \\}\n* ```\n*\n* For every \\\\(u < v\\\\) on the interval \\\\((0,1)\\\\),\n*\n* ```tex\n* P\\left \\[u < U \\leq v\\right \\] = v - u\n* ```\n*\n* Hence,\n*\n* ```tex\n* P\\left \\[N = n \\right \\] = P\\left \\[A_n\\right \\] = (1-p)^n - (1-p)^{n+1} = (1-p)^n(1-(1-p)) = p(1-p)^n\n* ```\n*\n* which proves that \\\\(N\\\\) is a geometric random variable.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction geometric( rand, p ) {\n\tvar u = rand();\n\tif ( u === 0.0 ) {\n\t\t// Drawing random variates from a PRNG (with period > 1) is effectively sampling without replacement. Thus, should not be possible to draw `0` twice in a row.\n\t\tu = rand();\n\t}\n\treturn floor( ln( u ) / ln( 1.0-p ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar geometric0 = require( './geometric.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating geometric distributed random numbers.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var geometric = factory( 0.5 );\n* var v = geometric();\n* // returns \n*\n* @example\n* var geometric = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = geometric();\n* // returns \n*\n* @example\n* var geometric = factory();\n* var v = geometric( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tp = arguments[ 0 ];\n\t\tif ( !isProbability( p ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( p === void 0 ) {\n\t\tprng = geometric2;\n\t} else {\n\t\tprng = geometric1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'geometric' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( p === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a geometric distribution with bound parameter `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = geometric1();\n\t* // returns \n\t*/\n\tfunction geometric1() {\n\t\treturn geometric0( rand, p );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a geometric distribution with parameter `p`.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = geometric2( 0.5 );\n\t* // returns \n\t*/\n\tfunction geometric2( p ) {\n\t\tif (\n\t\t\tisnan( p ) ||\n\t\t\tp < 0.0 ||\n\t\t\tp > 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn geometric0( rand, p );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom random number drawn from a geometric distribution with parameter `p`.\n*\n* @name geometric\n* @type {PRNG}\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = geometric( 0.5 );\n* // returns \n*\n* @example\n* var v = geometric( 3.14 );\n* // returns NaN\n*\n* @example\n* var v = geometric( -1.0 );\n* // returns NaN\n*\n* @example\n* var v = geometric( NaN );\n* // returns NaN\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Geometric distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/geometric\n*\n* @example\n* var geometric = require( '@stdlib/random/base/geometric' );\n*\n* var v = geometric( 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/geometric' ).factory;\n*\n* var geometric = factory( 0.3, {\n* 'seed': 297\n* });\n*\n* var v = geometric();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/geometric' ).factory;\n*\n* var geometric = factory({\n* 'seed': 297\n* });\n*\n* var v = geometric( 0.5 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/geometric' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var geometric = factory( 0.3 );\n* // returns \n*\n* var arr = geometric( 10 );\n* // returns \n*\n* @example\n* var geometric = factory( 0.3 );\n* // returns \n*\n* var arr = geometric( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a geometric distribution with success probability `p`.\n*\n* @name geometric\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = geometric( 10, 0.01 );\n* // returns \n*\n* @example\n* var arr = geometric( 10, 0.01, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a geometric distribution with success probability `p`.\n*\n* @module @stdlib/random/array/geometric\n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var arr = geometric( 10, 0.01 );\n* // returns \n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var arr = geometric( 10, 0.01, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var rand = geometric.factory( 0.01 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var rand = geometric.factory( 0.01 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar gamma = require( './../../../base/gamma' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating inverse gamma distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var invgamma = factory( 2.0, 1.0 );\n* var v = invgamma();\n* // returns \n*\n* @example\n* var invgamma = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = invgamma();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gamma();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trgamma = gamma( alpha, beta, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trgamma = gamma( alpha, beta, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trgamma = gamma( alpha, beta );\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = invgamma2;\n\t} else {\n\t\tprng = invgamma1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'invgamma' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma1();\n\t* // returns \n\t*/\n\tfunction invgamma1() {\n\t\treturn 1.0 / rgamma();\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma2( 2.0, 1.0 );\n\t* // returns \n\t*/\n\tfunction invgamma2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn 1.0 / rgamma( alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from an inverse gamma distribution.\n*\n* ## Method\n*\n* When\n*\n* ```tex\n* X \\sim \\operatorname{Gamma}( \\alpha, \\beta )\n* ```\n*\n* then\n*\n* ```tex\n* \\frac{1}{X} \\sim \\operatorname{InvGamma}\\left( \\alpha, \\tfrac{1}{beta} \\right)\n* ```\n*\n* Hence, to generate a draw from an inverse gamma distribution with parameters \\\\( \\alpha \\\\) and \\\\( \\beta \\\\), sample `X` from a \\\\( \\operatorname{Gamma}\\left( \\alpha, \\tfrac{1}{\\beta} \\right) \\\\) distribution and return `1/X`.\n*\n* @name invgamma\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = invgamma( 2.0, 1.0 );\n* // returns \n*\n* @example\n* var v = invgamma( -2.0, 5.0 );\n* // returns NaN\n*/\nvar invgamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Inverse gamma distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/invgamma\n*\n* @example\n* var invgamma = require( '@stdlib/random/base/invgamma' );\n*\n* var v = invgamma( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/invgamma' ).factory;\n* var invgamma = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = invgamma();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/invgamma' ).factory;\n* var invgamma = factory({\n* 'seed': 297\n* });\n*\n* var v = invgamma( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/invgamma' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var invgamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = invgamma( 10 );\n* // returns \n*\n* @example\n* var invgamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = invgamma( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = invgamma2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = invgamma2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = invgamma1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = invgamma1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from an inverse gamma distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction invgamma1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from an inverse gamma distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction invgamma2( len, alpha, beta, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ alpha ], [ beta ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( alpha, beta );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an inverse gamma distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter).\n*\n* @name invgamma\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = invgamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = invgamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar invgamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from an inverse gamma distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter).\n*\n* @module @stdlib/random/array/invgamma\n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var arr = invgamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var arr = invgamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var rand = invgamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var rand = invgamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale paramter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, sigma ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar exp = require( '@stdlib/math/base/special/exp' );\n\n\n// MAIN //\n\n/**\n* Returns a log-normally distributed pseudorandom number.\n*\n* @private\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction lognormal( randn, mu, sigma ) {\n\treturn exp( mu + (sigma*randn()) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar lognormal0 = require( './lognormal.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var lognormal = factory( 0.0, 1.0 );\n*\n* var v = lognormal();\n* // returns \n*\n* @example\n* var lognormal = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = lognormal();\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tsigma = arguments[ 1 ];\n\t\terr = validate( mu, sigma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = lognormal2;\n\t} else {\n\t\tprng = lognormal1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'lognormal' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a log-normally distributed pseudorandom number with bound parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = lognormal1();\n\t* // returns \n\t*/\n\tfunction lognormal1() {\n\t\treturn lognormal0( rnorm, mu, sigma );\n\t}\n\n\t/**\n\t* Returns a log-normally distributed pseudorandom number with parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = lognormal2( -2.0, 4.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = lognormal2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction lognormal2( mu, sigma ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn lognormal0( rnorm, mu, sigma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a log-normally distributed pseudorandom number with parameters `mu` and `sigma`.\n*\n* @name lognormal\n* @type {PRNG}\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var v = lognormal( -2.0, 4.0 );\n* // returns \n*\n* @example\n* var v = lognormal( 0.0, -1.0 );\n* // returns NaN\n*/\nvar lognormal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Log-normal distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/lognormal\n*\n* @example\n* var lognormal = require( '@stdlib/random/base/lognormal' );\n*\n* var v = lognormal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/lognormal' ).factory;\n* var lognormal = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = lognormal();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/lognormal' ).factory;\n* var lognormal = factory({\n* 'seed': 297\n* });\n*\n* var v = lognormal( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/lognormal' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var lognormal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = lognormal( 10 );\n* // returns \n*\n* @example\n* var lognormal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = lognormal( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = lognormal2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = lognormal2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = lognormal1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = lognormal1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a lognormal distribution with parameters `mu` (location parameter) and `sigma` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction lognormal1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a lognormal distribution with parameters `mu` (location parameter) and `sigma` (scale parameter).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction lognormal2( len, mu, sigma, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ mu ], [ sigma ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( mu, sigma );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a lognormal distribution with parameters `mu` (location parameter) and `sigma` (scale parameter).\n*\n* @name lognormal\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = lognormal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = lognormal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar lognormal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a lognormal distribution with parameters `mu` (location parameter) and `sigma` (scale parameter).\n*\n* @module @stdlib/random/array/lognormal\n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var arr = lognormal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var arr = lognormal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var rand = lognormal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var rand = lognormal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = INT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\([1, 2^{31}-1)\\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randint32();\n* // returns \n*/\nfunction randint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = randint32;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isInt32Array = require( '@stdlib/assert/is-int32array' );\nvar format = require( '@stdlib/string/format' );\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// VARIABLES //\n\nvar NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation\nvar MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation\nvar A = 16807|0; // asm type annotation\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 2; // state, seed\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = 4; // | version | num_sections | state_length | ...state | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = 5; // 1 (version) + 1 (num_sections) + 1 (state_length) + 1 (state) + 1 (seed_length)\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Int32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"state\" section must equal `1`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== 1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, 1, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n\n// MAIN //\n\n/**\n* Returns a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} a seed must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer\n* @throws {TypeError} state must be an `Int32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} LCG PRNG\n*\n* @example\n* var minstd = factory();\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* // Return a seeded LCG:\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isInt32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an Int32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Int32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state \"view\":\n\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed |= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) && seed.length > 0 ) {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = 1;\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state \"view\":\n\t\t\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate[ 0 ] = seed[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randint32()|0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randint32()|0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate[ 0 ] = seed[ 0 ];\n\t}\n\tsetReadOnly( minstd, 'NAME', 'minstd' );\n\tsetReadOnlyAccessor( minstd, 'seed', getSeed );\n\tsetReadOnlyAccessor( minstd, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( minstd, 'state', getState, setState );\n\tsetReadOnlyAccessor( minstd, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( minstd, 'byteLength', getStateSize );\n\tsetReadOnly( minstd, 'toJSON', toJSON );\n\tsetReadOnly( minstd, 'MIN', 1 );\n\tsetReadOnly( minstd, 'MAX', INT32_MAX-1 );\n\tsetReadOnly( minstd, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', minstd.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', (minstd.MIN-1.0) / NORMALIZATION_CONSTANT );\n\tsetReadOnly( normalized, 'MAX', (minstd.MAX-1.0) / NORMALIZATION_CONSTANT );\n\n\treturn minstd;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `2` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. internal PRNG state\n\t* 2. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `2`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - If PRNG state is \"shared\" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {TypeError} must provide an `Int32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isInt32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an Int32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Int32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = minstd.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*/\n\tfunction minstd() {\n\t\tvar s = state[ 0 ]|0; // asm type annotation\n\t\ts = ( (A*s)%INT32_MAX )|0; // asm type annotation\n\t\tstate[ 0 ] = s;\n\t\treturn s|0; // asm type annotation\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*/\n\tfunction normalized() {\n\t\treturn (minstd()-1) / NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n*\n* ## Method\n*\n* Linear congruential generators (LCGs) use the recurrence relation\n*\n* ```tex\n* X_{n+1} = ( a \\cdot X_n + c ) \\operatorname{mod}(m)\n* ```\n*\n* where the modulus \\\\( m \\\\) is a prime number or power of a prime number and \\\\( a \\\\) is a primitive root modulo \\\\( m \\\\).\n*\n* \n*\n* For an LCG to be a Lehmer RNG, the seed \\\\( X_0 \\\\) must be coprime to \\\\( m \\\\).\n*\n* \n*\n* In this implementation, the constants \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) have the values\n*\n* ```tex\n* \\begin{align*}\n* a &= 7^5 = 16807 \\\\\n* c &= 0 \\\\\n* m &= 2^{31} - 1 = 2147483647\n* \\end{align*}\n* ```\n*\n* \n*\n* The constant \\\\( m \\\\) is a Mersenne prime (modulo \\\\(31\\\\)).\n*\n* \n*\n* \n*\n* The constant \\\\( a \\\\) is a primitive root (modulo \\\\(31\\\\)).\n*\n* \n*\n* Accordingly, the maximum possible product is\n*\n* ```tex\n* 16807 \\cdot (m - 1) \\approx 2^{46}\n* ```\n*\n* The values for \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) are taken from Park and Miller, \"Random Number Generators: Good Ones Are Hard To Find\". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.\n*\n*\n* ## Notes\n*\n* - The generator has a period of approximately \\\\(2.1\\mbox{e}9\\\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).\n*\n*\n* ## References\n*\n* - Park, S. K., and K. W. Miller. 1988. \"Random Number Generators: Good Ones Are Hard to Find.\" _Communications of the ACM_ 31 (10). New York, NY, USA: ACM: 1192\u20131201. doi:[10.1145/63039.63042](http://dx.doi.org/10.1145/63039.63042).\n* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.\n*\n*\n* @function minstd\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = minstd();\n* // returns \n*/\nvar minstd = factory({\n\t'seed': randint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/base/minstd\n*\n* @example\n* var minstd = require( '@stdlib/random/base/minstd' );\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/minstd' ).factory;\n*\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/minstd' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = minstd;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction minstd( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Int32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Int32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Int32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @name minstd\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar minstd = factory();\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @module @stdlib/random/array/minstd\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// VARIABLES //\n\nvar NUM_WARMUPS = 8;\n\n\n// MAIN //\n\n/**\n* Initializes a shuffle table.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {Int32Array} table - table\n* @param {PositiveInteger} N - table size\n* @throws {Error} PRNG returned `NaN`\n* @returns {NumberArray} shuffle table\n*/\nfunction createTable( rand, table, N ) {\n\tvar v;\n\tvar i;\n\n\t// \"warm-up\" the PRNG...\n\tfor ( i = 0; i < NUM_WARMUPS; i++ ) {\n\t\tv = rand();\n\n\t\t// Prevent the above loop from being discarded by the compiler...\n\t\tif ( isnan( v ) ) {\n\t\t\tthrow new Error( 'unexpected error. PRNG returned NaN.' );\n\t\t}\n\t}\n\t// Initialize the shuffle table...\n\tfor ( i = N-1; i >= 0; i-- ) {\n\t\ttable[ i ] = rand();\n\t}\n\treturn table;\n}\n\n\n// EXPORTS //\n\nmodule.exports = createTable;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = INT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\([1, 2^{31}-1)\\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randint32();\n* // returns \n*/\nfunction randint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = randint32;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isInt32Array = require( '@stdlib/assert/is-int32array' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar createTable = require( './create_table.js' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// VARIABLES //\n\nvar NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation\nvar MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation\nvar A = 16807|0; // asm type annotation\n\n// Define the number of elements in the shuffle table:\nvar TABLE_LENGTH = 32;\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 3; // table, other, seed\n\n// Define the index offset of the \"table\" section in the state array:\nvar TABLE_SECTION_OFFSET = 2; // | version | num_sections | table_length | ...table | other_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = TABLE_LENGTH + 3; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = TABLE_LENGTH + 6; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = TABLE_LENGTH + 7; // 1 (version) + 1 (num_sections) + 1 (table_length) + TABLE_LENGTH (table) + 1 (state_length) + 1 (shuffle_state) + 1 (prng_state) + 1 (seed_length)\n\n// Define the indices for the shuffle table and PRNG states:\nvar SHUFFLE_STATE = STATE_SECTION_OFFSET + 1;\nvar PRNG_STATE = STATE_SECTION_OFFSET + 2;\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Int32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"table\" section must equal `TABLE_LENGTH`...\n\tif ( state[ TABLE_SECTION_OFFSET ] !== TABLE_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible table length. Expected: `%s`. Actual: `%s`.', s1, TABLE_LENGTH, state[ TABLE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"state\" section must equal `2`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== 2 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, 2, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n\n// MAIN //\n\n/**\n* Returns a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} a seed must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer\n* @throws {TypeError} state must be an `Int32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} shuffled LCG PRNG\n*\n* @example\n* var minstd = factory();\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* // Return a seeded LCG:\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 1421600654\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isInt32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an Int32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Int32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state (table) \"view\":\n\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed |= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) && seed.length > 0 ) {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = 2;\n\t\t\t\t\tSTATE[ PRNG_STATE ] = seed[ 0 ];\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state (table) \"view\":\n\t\t\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate = createTable( minstd, state, TABLE_LENGTH );\n\t\t\t\t\tSTATE[ SHUFFLE_STATE ] = state[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randint32()|0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randint32()|0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = 2;\n\t\tSTATE[ PRNG_STATE ] = seed;\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state (table) \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate = createTable( minstd, state, TABLE_LENGTH );\n\t\tSTATE[ SHUFFLE_STATE ] = state[ 0 ];\n\t}\n\tsetReadOnly( minstdShuffle, 'NAME', 'minstd-shuffle' );\n\tsetReadOnlyAccessor( minstdShuffle, 'seed', getSeed );\n\tsetReadOnlyAccessor( minstdShuffle, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( minstdShuffle, 'state', getState, setState );\n\tsetReadOnlyAccessor( minstdShuffle, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( minstdShuffle, 'byteLength', getStateSize );\n\tsetReadOnly( minstdShuffle, 'toJSON', toJSON );\n\tsetReadOnly( minstdShuffle, 'MIN', 1 );\n\tsetReadOnly( minstdShuffle, 'MAX', INT32_MAX-1 );\n\tsetReadOnly( minstdShuffle, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', minstdShuffle.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', (minstdShuffle.MIN-1.0) / NORMALIZATION_CONSTANT );\n\tsetReadOnly( normalized, 'MAX', (minstdShuffle.MAX-1.0) / NORMALIZATION_CONSTANT );\n\n\treturn minstdShuffle;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `3` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. shuffle table\n\t* 2. internal PRNG state\n\t* 3. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - If PRNG state is \"shared\" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {TypeError} must provide an `Int32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isInt32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an Int32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Int32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state (table) \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = minstdShuffle.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*/\n\tfunction minstd() {\n\t\tvar s = STATE[ PRNG_STATE ]|0; // asm type annotation\n\t\ts = ( (A*s)%INT32_MAX )|0; // asm type annotation\n\t\tSTATE[ PRNG_STATE ] = s;\n\t\treturn s|0; // asm type annotation\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*\n\t* @example\n\t* var v = minstd();\n\t* // returns \n\t*/\n\tfunction minstdShuffle() {\n\t\tvar s;\n\t\tvar i;\n\n\t\ts = STATE[ SHUFFLE_STATE ];\n\t\ti = floor( TABLE_LENGTH * (s/INT32_MAX) );\n\n\t\t// Pull a state from the table:\n\t\ts = state[ i ];\n\n\t\t// Update the PRNG state:\n\t\tSTATE[ SHUFFLE_STATE ] = s;\n\n\t\t// Replace the pulled state:\n\t\tstate[ i ] = minstd();\n\n\t\treturn s;\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normalized();\n\t* // returns \n\t*/\n\tfunction normalized() {\n\t\treturn (minstdShuffle()-1) / NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n*\n* ## Method\n*\n* Linear congruential generators (LCGs) use the recurrence relation\n*\n* ```tex\n* X_{n+1} = ( a \\cdot X_n + c ) \\operatorname{mod}(m)\n* ```\n*\n* where the modulus \\\\( m \\\\) is a prime number or power of a prime number and \\\\( a \\\\) is a primitive root modulo \\\\( m \\\\).\n*\n* \n*\n* For an LCG to be a Lehmer RNG, the seed \\\\( X_0 \\\\) must be coprime to \\\\( m \\\\).\n*\n* \n*\n* In this implementation, the constants \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) have the values\n*\n* ```tex\n* \\begin{align*}\n* a &= 7^5 = 16807 \\\\\n* c &= 0 \\\\\n* m &= 2^{31} - 1 = 2147483647\n* \\end{align*}\n* ```\n*\n* \n*\n* The constant \\\\( m \\\\) is a Mersenne prime (modulo \\\\(31\\\\)).\n*\n* \n*\n* \n*\n* The constant \\\\( a \\\\) is a primitive root (modulo \\\\(31\\\\)).\n*\n* \n*\n* Accordingly, the maximum possible product is\n*\n* ```tex\n* 16807 \\cdot (m - 1) \\approx 2^{46}\n* ```\n*\n* The values for \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) are taken from Park and Miller, \"Random Number Generators: Good Ones Are Hard To Find\". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.\n*\n* This implementation subsequently shuffles the output of a linear congruential pseudorandom number generator (LCG) using a shuffle table in accordance with the Bays-Durham algorithm.\n*\n* ## Notes\n*\n* - The generator has a period of approximately \\\\(2.1\\mbox{e}9\\\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).\n*\n* ## References\n*\n* - Bays, Carter, and S. D. Durham. 1976. \"Improving a Poor Random Number Generator.\" _ACM Transactions on Mathematical Software_ 2 (1). New York, NY, USA: ACM: 59\u201364. doi:[10.1145/355666.355670](http://dx.doi.org/10.1145/355666.355670).\n* - Herzog, T.N., and G. Lord. 2002. _Applications of Monte Carlo Methods to Finance and Insurance_. ACTEX Publications. [https://books.google.com/books?id=vC7I\\\\\\_gdX-A0C](https://books.google.com/books?id=vC7I\\_gdX-A0C).\n* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.\n*\n* @function minstd\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = minstd();\n* // returns \n*/\nvar minstd = factory({\n\t'seed': randint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/base/minstd-shuffle\n*\n* @example\n* var minstd = require( '@stdlib/random/base/minstd-shuffle' );\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/minstd-shuffle' ).factory;\n*\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 1421600654\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/minstd-shuffle' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = minstd;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction minstd( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Int32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Int32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Int32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @name minstd\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar minstd = factory();\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/array/minstd-shuffle\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\n", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/mt19937' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = mt19937;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[0, 4294967295]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction mt19937( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)` with 53-bit precision.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Uint32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Uint32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Uint32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @name mt19937\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var arr = mt19937.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar mt19937 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/array/mt19937\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937.normalized( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var rand = mt19937.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var rand = mt19937.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, sigma ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a pseudorandom number from a normal distribution with parameters `mu` and `sigma`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {number} pseudorandom number\n*/\nfunction normal( rand, mu, sigma ) {\n\treturn mu + (sigma*rand());\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar normal0 = require( './normal.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating normally distributed random numbers.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var normal = factory( 0.0, 1.0 );\n* var v = normal();\n* // returns \n*\n* @example\n* var normal = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = normal();\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tsigma = arguments[ 1 ];\n\t\terr = validate( mu, sigma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = normal2;\n\t} else {\n\t\tprng = normal1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'normal' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a normal distribution with bound parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal1();\n\t* // returns \n\t*/\n\tfunction normal1() {\n\t\treturn normal0( rnorm, mu, sigma );\n\t}\n\n\t/**\n\t* Returns a normally distributed pseudorandom number with mean `mu` and standard deviation `sigma`.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = normal2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction normal2( mu, sigma ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn normal0( rnorm, mu, sigma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a normally distributed pseudorandom number with mean `mu` and standard deviation `sigma`.\n*\n* @name normal\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = normal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var v = normal( 0.0, -1.0 );\n* // returns NaN\n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Normally distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/normal\n*\n* @example\n* var normal = require( '@stdlib/random/base/normal' );\n*\n* var v = normal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/normal' ).factory;\n* var normal = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = normal();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/normal' ).factory;\n* var normal = factory({\n* 'seed': 297\n* });\n*\n* var v = normal( -3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/normal' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var normal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = normal( 10 );\n* // returns \n*\n* @example\n* var normal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = normal( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = normal2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = normal2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = normal1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = normal1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a normal distribution with parameters `mu` (mean) and `sigma` (standard deviation).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normal1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a normal distribution with parameters `mu` (mean) and `sigma` (standard deviation).\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normal2( len, mu, sigma, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ mu ], [ sigma ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( mu, sigma );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a normal distribution with parameters `mu` (mean) and `sigma` (standard deviation).\n*\n* @name normal\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = normal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = normal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a normal distribution with parameters `mu` (mean) and `sigma` (standard deviation).\n*\n* @module @stdlib/random/array/normal\n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var arr = normal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var arr = normal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var rand = normal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var rand = normal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "{\n\t\"name\": \"mt19937\",\n\t\"copy\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar minstd = require( './../../../base/minstd' );\nvar minstdShuffle = require( './../../../base/minstd-shuffle' );\nvar mt19937 = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'minstd' ] = minstd;\nprngs[ 'minstd-shuffle' ] = minstdShuffle;\nprngs[ 'mt19937' ] = mt19937;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating uniformly distributed random numbers on the interval \\\\( [0,1) \\\\).\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of pseudorandom number generator\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var uniform = factory();\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'name': 'minstd'\n* });\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'seed': 12345\n* });\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n* var v = uniform();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( opts.seed === void 0 ) {\n\t\t\trand = prng.factory();\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'seed': opts.seed\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'state': opts.state,\n\t\t\t'copy': opts.copy\n\t\t});\n\t}\n\tsetReadOnly( uniform, 'NAME', 'randu' );\n\tsetReadOnlyAccessor( uniform, 'seed', getSeed );\n\tsetReadOnlyAccessor( uniform, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( uniform, 'state', getState, setState );\n\tsetReadOnlyAccessor( uniform, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( uniform, 'byteLength', getStateSize );\n\tsetReadOnly( uniform, 'toJSON', toJSON );\n\tsetReadOnly( uniform, 'PRNG', rand );\n\tsetReadOnly( uniform, 'MIN', rand.normalized.MIN );\n\tsetReadOnly( uniform, 'MAX', rand.normalized.MAX );\n\n\treturn uniform;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = uniform.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform();\n\t* // returns \n\t*/\n\tfunction uniform() {\n\t\treturn rand.normalized();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a uniformly distributed random number on the interval \\\\( [0,1) \\\\).\n*\n* @name randu\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = randu();\n* // returns \n*/\nvar randu = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Uniformly distributed pseudorandom numbers on the interval \\\\( [0,1) \\\\).\n*\n* @module @stdlib/random/base/randu\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* var v = randu();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randu' ).factory;\n*\n* var randu = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n*\n* var v = randu();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/randu' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var randu = factory();\n* // returns \n*\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var randu = factory();\n* // returns \n*\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\trand = randu;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a randu distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction randu( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @name randu\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar randu = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/array/randu\n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var rand = randu.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var rand = randu.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} a - minimum support (inclusive)\n* @param {number} b - maximum support (exclusive)\n* @returns {number} pseudorandom number\n*/\nfunction uniform( rand, a, b ) {\n\tvar r = rand();\n\treturn ( b*r ) + ( (1.0-r)*a ); // equivalent to (b-a)*r + a\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar uniform0 = require( './uniform.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating uniformly distributed random numbers.\n*\n* @param {number} [a] - minimum support (inclusive)\n* @param {number} [b] - maximum support (exclusive)\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var uniform = factory( 0.0, 1.0 );\n*\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory( -3.0, -1.0, {\n* 'seed': 297\n* });\n* var v = uniform();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = uniform2;\n\t} else {\n\t\tprng = uniform1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'uniform' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform1();\n\t* // returns \n\t*/\n\tfunction uniform1() {\n\t\treturn uniform0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support (inclusive)\n\t* @param {number} b - maximum support (exclusive)\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = uniform2( 1.0, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction uniform2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta >= b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn uniform0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @name uniform\n* @type {PRNG}\n* @param {number} a - minimum support (inclusive)\n* @param {number} b - maximum support (exclusive)\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = uniform( 0.0, 1.0 );\n* // returns \n*/\nvar uniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Uniform distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/uniform\n*\n* @example\n* var uniform = require( '@stdlib/random/base/uniform' );\n*\n* var v = uniform( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/uniform' ).factory;\n* var uniform = factory( -5.0, 5.0, {\n* 'seed': 297\n* });\n*\n* var v = uniform();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/uniform' ).factory;\n* var uniform = factory({\n* 'seed': 297\n* });\n*\n* var v = uniform( -5.0, 5.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar base = require( './../../../base/uniform' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var uniform = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = uniform( 10 );\n* // returns \n*\n* @example\n* var uniform = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = uniform( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t\trand = uniform2;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = uniform2;\n\t} else if ( nargs === 2 ) {\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ] );\n\t\trand = uniform1;\n\t} else if ( nargs === 3 ) {\n\t\toptions = arguments[ 2 ];\n\t\tprng = base.factory( arguments[ 0 ], arguments[ 1 ], options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\trand = uniform1;\n\t}\n\tif ( options && options.prng ) {\n\t\tsetReadOnly( rand, 'seed', null );\n\t\tsetReadOnly( rand, 'seedLength', null );\n\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( rand, 'stateLength', null );\n\t\tsetReadOnly( rand, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a continuous uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction uniform1( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a continuous uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction uniform2( len, a, b, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 3 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t// NOTE: we could alternatively use the PRNG factory function to create a PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. Decision made here to avoid this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom number. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in a return value of `NaN`.\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, wrapper );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tbinary( [ [ a ], [ b ], out ], [ len ], [ 0, 0, 1 ], prng );\n\t\treturn out;\n\n\t\t/**\n\t\t* Applies parameters to a pseudorandom number generator function.\n\t\t*\n\t\t* @private\n\t\t* @returns {number} pseudorandom number\n\t\t*/\n\t\tfunction wrapper() {\n\t\t\treturn prng( a, b );\n\t\t}\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a continuous uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @name uniform\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = uniform( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = uniform( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar uniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a continuous uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @module @stdlib/random/array/uniform\n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var arr = uniform( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var arr = uniform( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var rand = uniform.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var rand = uniform.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../array/arcsine' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../array/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../array/betaprime' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../array/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../array/discrete-uniform' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../array/exponential' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../array/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../array/geometric' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../array/invgamma' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../array/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../array/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../array/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../array/mt19937' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../array/normal' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../array/randu' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../array/uniform' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Bernoulli distributed random numbers.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var bernoulli = factory( 0.5 );\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var bernoulli = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var bernoulli = factory();\n* var v = bernoulli( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tp = arguments[ 0 ];\n\t\tif ( !isProbability( p ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( p === void 0 ) {\n\t\tprng = bernoulli2;\n\t} else {\n\t\tprng = bernoulli1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'bernoulli' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( p === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Bernoulli distribution with bound parameter `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = bernoulli1();\n\t* // returns \n\t*/\n\tfunction bernoulli1() {\n\t\treturn ( rand() <= p ) ? 1 : 0;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Bernoulli distribution with parameter `p`.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = bernoulli2( 0.5 );\n\t* // returns \n\t*/\n\tfunction bernoulli2( p ) {\n\t\tif (\n\t\t\tisnan( p ) ||\n\t\t\tp < 0.0 ||\n\t\t\tp > 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn ( rand() <= p ) ? 1 : 0;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom random number drawn from a Bernoulli distribution with parameter `p`.\n*\n* @name bernoulli\n* @type {PRNG}\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = bernoulli( 0.5 );\n* // returns \n*\n* @example\n* var v = bernoulli( 3.14 );\n* // returns NaN\n*\n* @example\n* var v = bernoulli( -1.0 );\n* // returns NaN\n*\n* @example\n* var v = bernoulli( NaN );\n* // returns NaN\n*/\nvar bernoulli = factory();\n\n\n// EXPORTS //\n\nmodule.exports = bernoulli;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Bernoulli distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/bernoulli\n*\n* @example\n* var bernoulli = require( '@stdlib/random/base/bernoulli' );\n*\n* var v = bernoulli( 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/bernoulli' ).factory;\n*\n* var bernoulli = factory( 0.3, {\n* 'seed': 297\n* });\n*\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/bernoulli' ).factory;\n*\n* var bernoulli = factory({\n* 'seed': 297\n* });\n*\n* var v = bernoulli( 0.5 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 10, 0.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( n, p ) {\n\tif ( !isPositiveInteger( n ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', p ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generates a binomially distributed pseudorandom number by computing the sum of Bernoulli random variables.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tvar sum = 0;\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tif ( rand() <= p ) {\n\t\t\tsum += 1;\n\t\t}\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// VARIABLES //\n\nvar ONE_12 = 1.0 / 12.0;\nvar ONE_360 = 1.0 / 360.0;\nvar ONE_1260 = 1.0 / 1260.0;\n\n\n// MAIN //\n\n/**\n* Returns a correction for Stirling's approximation.\n*\n* @private\n* @param {NonNegativeInteger} k - input argument\n* @returns {number} correction term\n*\n* @example\n* var c = correction( 0 );\n* // returns 0.08106146679532726\n*/\nfunction correction( k ) {\n\tvar v;\n\tswitch ( k ) {\n\tcase 0:\n\t\treturn 0.08106146679532726;\n\tcase 1:\n\t\treturn 0.04134069595540929;\n\tcase 2:\n\t\treturn 0.02767792568499834;\n\tcase 3:\n\t\treturn 0.02079067210376509;\n\tcase 4:\n\t\treturn 0.01664469118982119;\n\tcase 5:\n\t\treturn 0.01387612882307075;\n\tcase 6:\n\t\treturn 0.01189670994589177;\n\tcase 7:\n\t\treturn 0.01041126526197209;\n\tcase 8:\n\t\treturn 0.009255462182712733;\n\tcase 9:\n\t\treturn 0.008330563433362871;\n\tdefault:\n\t\tk += 1;\n\t\tv = pow( k, 2 );\n\t\treturn (ONE_12 - ((ONE_360 - (ONE_1260/v)) / v)) / k;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = correction;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar correction = require( './correction.js' );\n\n\n// VARIABLES //\n\nvar ONE_SIXTH = 1.0 / 6.0;\n\n\n// MAIN //\n\n/**\n* Generates a binomially distributed pseudorandom number.\n*\n* ## References\n*\n* - H\u00F6rmann, Wolfgang. 1993. \"The generation of binomial random variates.\" _Journal of Statistical Computation and Simulation_ 46 (1-2): 101\u201310. doi:[10.1080/00949659308811496][@hormann:1993a].\n*\n* [@hormann:1993a]: http://dx.doi.org/10.1080/00949659308811496\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tvar alpha;\n\tvar urvr;\n\tvar snpq;\n\tvar npq;\n\tvar rho;\n\tvar tmp;\n\tvar nm;\n\tvar nr;\n\tvar us;\n\tvar km;\n\tvar nk;\n\tvar vr;\n\tvar a;\n\tvar b;\n\tvar c;\n\tvar f;\n\tvar h;\n\tvar i;\n\tvar k;\n\tvar m;\n\tvar q;\n\tvar r;\n\tvar t;\n\tvar u;\n\tvar v;\n\tvar x;\n\n\tm = floor( (n + 1) * p );\n\tnm = n - m + 1;\n\n\tq = 1.0 - p;\n\n\tr = p / q;\n\tnr = (n + 1) * r;\n\n\tnpq = n * p * q;\n\tsnpq = sqrt( npq );\n\n\tb = 1.15 + (2.53 * snpq);\n\ta = -0.0873 + (0.0248*b) + (0.01*p);\n\tc = (n*p) + 0.5;\n\n\talpha = (2.83 + (5.1/b)) * snpq;\n\n\tvr = 0.92 - (4.2/b);\n\turvr = 0.86 * vr;\n\n\th = (m + 0.5) * ln( (m+1) / (r*nm) );\n\th += correction( m ) + correction( n-m );\n\n\twhile ( true ) {\n\t\tv = rand();\n\t\tif ( v <= urvr ) {\n\t\t\tu = (v/vr) - 0.43;\n\t\t\tr = (u * ( (2.0*a / (0.5 - abs(u))) + b )) + c;\n\t\t\treturn floor( r );\n\t\t}\n\t\tif ( v >= vr ) {\n\t\t\tu = rand() - 0.5;\n\t\t} else {\n\t\t\tu = (v/vr) - 0.93;\n\t\t\tu = (sign( u ) * 0.5) - u;\n\t\t\tv = vr * rand();\n\t\t}\n\t\tus = 0.5 - abs(u);\n\t\tk = floor( (u * ( (2.0*a/us) + b )) + c );\n\t\tif ( k < 0 || k > n ) {\n\t\t\t// Try again...\n\t\t\tcontinue;\n\t\t}\n\t\tv = v * alpha / ( (a/(us*us)) + b );\n\t\tkm = abs( k - m );\n\t\tif ( km > 15 ) {\n\t\t\tv = ln( v );\n\t\t\trho = km / npq;\n\t\t\ttmp = ( (km/3) + 0.625 ) * km;\n\t\t\ttmp += ONE_SIXTH;\n\t\t\ttmp /= npq;\n\t\t\trho *= tmp + 0.5;\n\t\t\tt = -(km * km) / (2.0 * npq);\n\t\t\tif ( v < t - rho ) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tif ( v <= t + rho ) {\n\t\t\t\tnk = n - k + 1;\n\t\t\t\tx = h + ( (n+1)*ln( nm/nk ) );\n\t\t\t\tx += (k+0.5) * ln( nk*r/(k+1) );\n\t\t\t\tx += -(correction( k ) + correction( n-k ));\n\t\t\t\tif ( v <= x ) {\n\t\t\t\t\treturn k;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tf = 1.0;\n\t\t\tif ( m < k ) {\n\t\t\t\tfor ( i = m; i <= k; i++ ) {\n\t\t\t\t\tf *= (nr/i) - r;\n\t\t\t\t}\n\t\t\t} else if ( m > k ) {\n\t\t\t\tfor ( i = k; i <= m; i++ ) {\n\t\t\t\t\tv *= (nr/i) - r;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( v <= f ) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sample1 = require( './sample1.js' );\nvar sample2 = require( './sample2.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a binomial distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - probability of success\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tif ( p > 0.5 ) {\n\t\treturn n - sample( rand, n, 1.0-p );\n\t}\n\tif ( n*p < 10.0 ) {\n\t\treturn sample1( rand, n, p );\n\t}\n\treturn sample2( rand, n, p );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' );\nvar isProbability = require( '@stdlib/math/base/assert/is-probability' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar binomial0 = require( './binomial.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating binomially distributed random numbers.\n*\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var binomial = factory( 17, 0.5 );\n* var v = binomial();\n* // returns \n*\n* @example\n* var binomial = factory( 8, 0.8, {\n* 'seed': 297\n* });\n* var v = binomial();\n* // returns \n*\n* @example\n* var binomial = factory();\n* var v = binomial( 20, 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar n;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tn = arguments[ 0 ];\n\t\tp = arguments[ 1 ];\n\t\terr = validate( n, p );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( n === void 0 ) {\n\t\tprng = binomial2;\n\t}\n\telse {\n\t\tprng = binomial1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'binomial' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( n === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ n, p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a binomial distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var r = binomial1();\n\t* // returns \n\t*/\n\tfunction binomial1() {\n\t\treturn binomial0( rand, n, p );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} n - number of trials\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var r = binomial2( 20, 0.8 );\n\t* // returns \n\t*/\n\tfunction binomial2( n, p ) {\n\t\tif (\n\t\t\tisnan( n ) ||\n\t\t\tisnan( p ) ||\n\t\t\t!isPositiveInteger( n ) ||\n\t\t\t!isProbability( p )\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn binomial0( rand, n, p );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a binomially distributed random number.\n*\n* ## Method\n*\n* - For \\\\(np < 10\\\\), the function generates Bernoulli random variates and returns their sum.\n* - For \\\\(np \\geq 10\\\\), the function uses the [BTRD algorithm][@hormann:1993a].\n*\n* ## References\n*\n* - H\u00F6rmann, Wolfgang. 1993. \"The generation of binomial random variates.\" _Journal of Statistical Computation and Simulation_ 46 (1-2): 101\u201310. doi:[10.1080/00949659308811496][@hormann:1993a].\n*\n* [@hormann:1993a]: http://dx.doi.org/10.1080/00949659308811496\n*\n* @name binomial\n* @type {PRNG}\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var r = binomial( 20, 0.8 );\n* // returns \n*/\nvar binomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = binomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Binomial distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/binomial\n*\n* @example\n* var binomial = require( '@stdlib/random/base/binomial' );\n*\n* var v = binomial( 20, 0.4 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/binomial' ).factory;\n*\n* var binomial = factory( 90, 0.8, {\n* 'seed': 297\n* });\n*\n* var v = binomial();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar sin = require( '@stdlib/math/base/special/sin' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar TWO_PI = require( '@stdlib/constants/float64/two-pi' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating standard normally distributed pseudorandom numbers using the Box-Muller algorithm.\n*\n* @private\n* @param {PRNG} rand - PRNG which returns standard uniformly distributed numbers\n* @returns {PRNG} PRNG\n*/\nfunction wrap( rand ) {\n\tvar flg;\n\tvar r;\n\n\t// Flag indicating whether to generate new normal random variates or return a cached normal random variate:\n\tflg = true;\n\n\treturn randn;\n\n\t/**\n\t* Generates a standard normally distributed pseudorandom number.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = randn();\n\t* // returns \n\t*/\n\tfunction randn() {\n\t\tvar u1;\n\t\tvar u2;\n\t\tvar a;\n\t\tvar b;\n\t\tif ( flg ) {\n\t\t\t// Note: if `u1` is `0`, the natural log blows up, so we keep trying until we get a non-zero rand. Rarely should we need more than one iteration.\n\t\t\tdo {\n\t\t\t\tu1 = rand();\n\t\t\t\tu2 = rand();\n\t\t\t} while (\n\t\t\t\tu1 === 0.0\n\t\t\t);\n\t\t\ta = sqrt( -2.0 * ln(u1) );\n\t\t\tb = TWO_PI * u2;\n\t\t\tr = a * cos( b ); // cache for next call\n\t\t\tflg = false;\n\t\t\treturn a * sin( b );\n\t\t}\n\t\tflg = true;\n\t\treturn r;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar PI = require( '@stdlib/constants/float64/pi' );\n\n\n// VARIABLES //\n\nvar COS_PI = cos( PI ); // -1\n\n\n// MAIN //\n\n/**\n* Returns the minimum possible normally distributed pseudorandom number.\n*\n* @private\n* @param {number} min - minimum possible uniformly distributed pseudorandom number\n* @returns {number} minimum possible number\n*/\nfunction getMin( min ) {\n\tvar a = sqrt( -2.0 * ln( min ) );\n\treturn a * COS_PI;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getMin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar TWO_PI = require( '@stdlib/constants/float64/two-pi' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum possible normally distributed pseudorandom number.\n*\n* @private\n* @param {number} min - minimum possible uniformly distributed pseudorandom number\n* @returns {number} maximum possible number\n*/\nfunction getMax( min ) {\n\tvar a = sqrt( -2.0 * ln( min ) );\n\tvar b = TWO_PI * min;\n\treturn a * cos( b );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getMax;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar randn0 = require( './randn.js' );\nvar getMin = require( './min.js' );\nvar getMax = require( './max.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the Box-Muller transform to generate standard normally distributed pseudorandom numbers.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var r = randn();\n* // returns \n*\n* @example\n* // Return a seeded PRNG:\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar randu;\n\tvar randn;\n\tvar rand;\n\tvar opts;\n\n\topts = {\n\t\t'copy': true\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\t\tif ( !isFunction( options.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', options.prng ) );\n\t\t\t}\n\t\t\trandu = options.prng;\n\t\t}\n\t\t// If provided a PRNG, ignore the `state` option, as we don't support getting or setting PRNG state.\n\t\telse if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( !isUint32Array( options.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', options.state ) );\n\t\t\t}\n\t\t}\n\t\t// If provided a PRNG, ignore the `seed` option, as a `seed`, by itself, is insufficient to guarantee reproducibility. If provided a state, ignore the `seed` option, as a PRNG state should contain seed information.\n\t\telse if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( options.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', options.seed ) );\n\t\t\t}\n\t\t}\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( randu === void 0 ) {\n\t\t\trand = mt19937( opts );\n\t\t\trandu = rand.normalized;\n\t\t} else {\n\t\t\topts.seed = null;\n\t\t}\n\t} else {\n\t\trand = mt19937( opts );\n\t\trandu = rand.normalized;\n\t}\n\trandn = randn0( randu );\n\n\tsetReadOnly( randn, 'NAME', 'box-muller' );\n\tif ( opts.seed === null ) {\n\t\tsetReadOnly( randn, 'seed', null );\n\t\tsetReadOnly( randn, 'seedLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( randn, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( randn, 'seedLength', getSeedLength );\n\t}\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( options && options.prng ) {\n\t\tsetReadWriteAccessor( randn, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( randn, 'stateLength', null );\n\t\tsetReadOnly( randn, 'byteLength', null );\n\t\tsetReadOnly( randn, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadWriteAccessor( randn, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( randn, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( randn, 'byteLength', getStateSize );\n\t\tsetReadOnly( randn, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( randn, 'PRNG', randu );\n\n\tif ( hasOwnProp( randu, 'MIN' ) ) {\n\t\tsetReadOnly( randn, 'MIN', getMin( randu.MIN ) );\n\t\tsetReadOnly( randn, 'MAX', getMax( randu.MIN ) );\n\t} else {\n\t\tsetReadOnly( randn, 'MIN', null );\n\t\tsetReadOnly( randn, 'MAX', null );\n\t}\n\n\treturn randn;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = randn.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a standard normally distributed random number.\n*\n* ## Method\n*\n* - Given two independent uniformly distributed random variables \\\\( U_1 \\\\) and \\\\( U_2 \\\\) in the interval \\\\( [0,1) \\\\), let\n*\n* ``` tex\n* \\begin{align*}\n* Z_1 &= R \\cos(\\theta) = \\sqrt{-2 \\ln(U_1)} \\cos(2\\pi U_2) \\\\\n* Z_2 &= R \\sin(\\theta) = \\sqrt{-2 \\ln(U_1)} \\sin(2\\pi U_2)\n* \\end{align*}\n* ```\n*\n* where \\\\( Z_1 \\\\) and \\\\( Z_2 \\\\) are independent random variables with a standard normal distribution.\n*\n* - As two uniform random variates are mapped to two standard normal random variates, one of the random variates is cached and returned upon the following invocation.\n*\n* ## Notes\n*\n* - The minimum and maximum pseudorandom numbers which can be generated are dependent on the number of bits an underlying uniform pseudorandom number generator (PRNG) uses. For instance, if a PRNG uses \\\\( 32 \\\\) bits, the smallest non-zero number that can be generated is \\\\( 2^{-32}). When \\\\( U_1 \\\\) equals this value and \\\\( U_2 \\\\) equals \\\\( 0 \\\\),\n*\n* ``` tex\n* r = \\sqrt{-2\\ln(2^{-32})} \\cos(2\\pi) \\approx 6.66\n* ```\n*\n* which means that the algorithm cannot produce random variates more than \\\\( 6.66 \\\\) standard deviations from the mean.\n*\n* \n*\n* This corresponds to a \\\\( 2.74 \\times 10^{-11} \\\\) loss due to tail truncation.\n*\n* \n*\n* ## References\n*\n* - Box, G. E. P., and Mervin E. Muller. 1958. \"A Note on the Generation of Random Normal Deviates.\" _The Annals of Mathematical Statistics_ 29 (2). The Institute of Mathematical Statistics: 610\u201311. doi:[10.1214/aoms/1177706645](http://dx.doi.org/10.1214/aoms/1177706645).\n* - Bell, James R. 1968. \"Algorithm 334: Normal Random Deviates.\" _Communications of the ACM_ 11 (7). New York, NY, USA: ACM: 498. doi:[10.1145/363397.363547](http://dx.doi.org/10.1145/363397.363547).\n* - Knop, R. 1969. \"Remark on Algorithm 334 \\[G5]: Normal Random Deviates.\" _Communications of the ACM_ 12 (5). New York, NY, USA: ACM: 281. doi:[10.1145/362946.362996](http://dx.doi.org/10.1145/362946.362996).\n* - Marsaglia, G., and T. A. Bray. 1964. \"A Convenient Method for Generating Normal Variables.\" _SIAM Review_ 6 (3). Society for Industrial; Applied Mathematics: 260\u201364. doi:[10.1137/1006063](http://dx.doi.org/10.1137/1006063).\n* - Thomas, David B., Wayne Luk, Philip H.W. Leong, and John D. Villasenor. 2007. \"Gaussian Random Number Generators.\" _ACM Computing Surveys_ 39 (4). New York, NY, USA: ACM. doi:[10.1145/1287620.1287622](http://dx.doi.org/10.1145/1287620.1287622).\n*\n* @name randn\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var r = randn();\n* // returns \n*/\nvar randn = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Normally distributed pseudorandom numbers using the Box-Muller transform.\n*\n* @module @stdlib/random/base/box-muller\n*\n* @example\n* var randn = require( '@stdlib/random/base/box-muller' );\n*\n* var r = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/box-muller' ).factory;\n*\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( x0, gamma ) {\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositive( gamma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar tan = require( '@stdlib/math/base/special/tan' );\nvar PI = require( '@stdlib/constants/float64/pi' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Cauchy distribution.\n*\n* @private\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction cauchy( randn, x0, gamma ) {\n\treturn x0 + ( gamma*tan( PI*( randn()-0.5 ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar cauchy0 = require( './cauchy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Cauchy distribution.\n*\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var cauchy = factory( 0.0, 1.0 );\n* var v = cauchy();\n* // returns \n*\n* @example\n* var cauchy = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = cauchy();\n* // returns \n*/\nfunction factory() {\n\tvar gamma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar x0;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tx0 = arguments[ 0 ];\n\t\tgamma = arguments[ 1 ];\n\t\terr = validate( x0, gamma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( x0 === void 0 ) {\n\t\tprng = cauchy2;\n\t} else {\n\t\tprng = cauchy1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'cauchy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( x0 === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ x0, gamma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Cauchy distribution with bound parameters `x0` and `gamma`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cauchy1();\n\t* // returns \n\t*/\n\tfunction cauchy1() {\n\t\treturn cauchy0( rnorm, x0, gamma );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @param {number} x0 - location parameter\n\t* @param {PositiveNumber} gamma - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cauchy2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var r = cauchy2( 1.0, -1.5 );\n\t* // returns NaN\n\t*/\n\tfunction cauchy2( x0, gamma ) {\n\t\tif (\n\t\t\tisnan( x0 ) ||\n\t\t\tisnan( gamma ) ||\n\t\t\tgamma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn cauchy0( rnorm, x0, gamma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Cauchy distribution.\n*\n* @name cauchy\n* @type {PRNG}\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = cauchy( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = cauchy( 0.0, -1.0 );\n* // returns NaN\n*/\nvar cauchy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Cauchy distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/cauchy\n*\n* @example\n* var cauchy = require( '@stdlib/random/base/cauchy' );\n*\n* var v = cauchy( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cauchy' ).factory;\n*\n* var cauchy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = cauchy();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar gamma = require( './../../../base/gamma' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating chi-square distributed random numbers.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var chisquare = factory( 2 );\n* var v = chisquare();\n* // returns \n*\n* @example\n* var chisquare = factory( 2, {\n* 'seed': 297\n* });\n* var v = chisquare();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar k;\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gamma();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tif ( !isPositive( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trgamma = gamma( k/2.0, 0.5, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trgamma = gamma( k/2.0, 0.5, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trgamma = gamma( k/2.0, 0.5 );\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = chisquare2;\n\t} else {\n\t\tprng = chisquare1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'chisquare' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi-square distribution with bound `k`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chisquare1();\n\t* // returns \n\t*/\n\tfunction chisquare1() {\n\t\treturn rgamma();\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi-square distribution with degrees of freedom `k`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chisquare2( 2 );\n\t* // returns \n\t*/\n\tfunction chisquare2( k ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tk <= 0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rgamma( k/2.0, 0.5 );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a chi-square distribution with degrees of freedom `k`.\n*\n* @function chisquare\n* @type {PRNG}\n* @param {PositiveNumber} k - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = chisquare( 2 );\n* // returns \n*\n* @example\n* var v = chisquare( 0 );\n* // returns NaN\n*\n* @example\n* var v = chisquare( NaN );\n* // returns NaN\n*/\nvar chisquare = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chisquare;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Chi-square distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/chisquare\n*\n* @example\n* var chisquare = require( '@stdlib/random/base/chisquare' );\n*\n* var v = chisquare( 6 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/chisquare' ).factory;\n*\n* var chisquare = factory( 3, {\n* 'seed': 297\n* });\n*\n* var v = chisquare();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating chi distributed random numbers.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var chi = factory( 2 );\n* var v = chi();\n* // returns \n*\n* @example\n* var chi = factory( 2, {\n* 'seed': 297\n* });\n* var v = chi();\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar k;\n\tif ( arguments.length === 0 ) {\n\t\trchisq = chisquare();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tif ( !isPositive( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trchisq = chisquare( k, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trchisq = chisquare( k, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trchisq = chisquare( k );\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = chi2;\n\t} else {\n\t\tprng = chi1;\n\t}\n\trand = rchisq.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'chi' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi distribution with bound `k`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chi1();\n\t* // returns \n\t*/\n\tfunction chi1() {\n\t\treturn sqrt( rchisq() );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi distribution with degrees of freedom `k`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chi2( 2 );\n\t* // returns \n\t*/\n\tfunction chi2( k ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tk <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn sqrt( rchisq( k ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a chi distribution with degrees of freedom `k`.\n*\n* @name chi\n* @type {PRNG}\n* @param {PositiveNumber} k - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = chi( 2 );\n* // returns \n*\n* @example\n* var v = chi( 0 );\n* // returns NaN\n*\n* @example\n* var v = chi( NaN );\n* // returns NaN\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Chi distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/chi\n*\n* @example\n* var chi = require( '@stdlib/random/base/chi' );\n*\n* var v = chi( 6 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/chi' ).factory;\n*\n* var chi = factory( 3, {\n* 'seed': 297\n* });\n*\n* var v = chi();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 2.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( k, lambda ) {\n\tif ( !isPositiveInteger( k ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositive( lambda ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an Erlang distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = erlang();\n* // returns \n*/\nfunction erlang( rand, k, lambda ) {\n\tvar prod;\n\tvar i;\n\tprod = 1.0;\n\tfor ( i = 0; i < k; i++ ) {\n\t\tprod *= rand();\n\t}\n\treturn -(1.0/lambda) * ln( prod );\n}\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar erlang0 = require( './erlang.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Erlang distributed random numbers.\n*\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var erlang = factory( 2, 1.0 );\n* var v = erlang();\n* // returns \n*\n* @example\n* var erlang = factory( 2, 2.0, {\n* 'seed': 297\n* });\n* var v = erlang();\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar err;\n\tvar k;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tlambda = arguments[ 1 ];\n\t\terr = validate( k, lambda );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = erlang2;\n\t} else {\n\t\tprng = erlang1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'erlang' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k, lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an Erlang distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = erlang1();\n\t* // returns \n\t*/\n\tfunction erlang1() {\n\t\treturn erlang0( rand, k, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} k - shape parameter\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = erlang2( 2, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = erlang2( NaN, 1.0 );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 2, NaN );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 3.14, 1.0 );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 2, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction erlang2( k, lambda ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tisnan( lambda ) ||\n\t\t\t!isPositiveInteger( k ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn erlang0( rand, k, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an Erlang distribution.\n*\n* @name erlang\n* @type {PRNG}\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = erlang( 2, 1.0 );\n* // returns \n*\n* @example\n* var v = erlang( NaN, 1.0 );\n* // returns NaN\n*\n* v = erlang( 2, NaN );\n* // returns NaN\n*\n* v = erlang( 3.14, 1.0 );\n* // returns NaN\n*\n* v = erlang( 3, 0.0 );\n* // returns NaN\n*/\nvar erlang = factory();\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Erlang distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/erlang\n*\n* @example\n* var erlang = require( '@stdlib/random/base/erlang' );\n*\n* var v = erlang( 3, 2.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/erlang' ).factory;\n*\n* var erlang = factory( 8, 5.9, {\n* 'seed': 297\n* });\n*\n* var v = erlang();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( d1, d2 ) {\n\tif ( !isPositive( d1 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositive( d2 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n*\n* @private\n* @param {PRNG} rchisq - PRNG for chi-square distributed numbers\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction f( rchisq, d1, d2 ) {\n\tvar x1 = rchisq( d1 ) / d1;\n\tvar x2 = rchisq( d2 ) / d2;\n\treturn x1 / x2;\n}\n\n\n// EXPORTS //\n\nmodule.exports = f;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar f0 = require( './f.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating F distributed random numbers.\n*\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var f = factory( 1.0, 2.0 );\n* var v = f();\n* // returns \n*\n* @example\n* var f = factory( 0.5, 3.0, {\n* 'seed': 297\n* });\n* var v = f();\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar d1;\n\tvar d2;\n\n\tif ( arguments.length === 0 ) {\n\t\trchisq = chisquare();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( opts );\n\t\t}\n\t} else {\n\t\td1 = arguments[ 0 ];\n\t\td2 = arguments[ 1 ];\n\t\terr = validate( d1, d2 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trchisq = chisquare({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trchisq = chisquare( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trchisq = chisquare();\n\t\t}\n\t}\n\tif ( d1 === void 0 ) {\n\t\tprng = f2;\n\t} else {\n\t\tprng = f1;\n\t}\n\trand = rchisq.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'f' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( d1 === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ d1, d2 ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from an F distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = f1();\n\t* // returns \n\t*/\n\tfunction f1() {\n\t\treturn f0( rchisq, d1, d2 );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} d1 - degrees of freedom\n\t* @param {PositiveNumber} d2 - degrees of freedom\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = f2( 3.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = f2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = f2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = f2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction f2( d1, d2 ) {\n\t\tif (\n\t\t\tisnan( d1 ) ||\n\t\t\tisnan( d2 ) ||\n\t\t\td1 <= 0.0 ||\n\t\t\td2 <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn f0( rchisq, d1, d2 );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n*\n* @name f\n* @type {PRNG}\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = f( 3.0, 2.0 );\n* // returns \n*\n* @example\n* var r = f( -2.0, 5.0 );\n* // returns NaN\n*/\nvar f = factory();\n\n\n// EXPORTS //\n\nmodule.exports = f;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* F distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/f\n*\n* @example\n* var f = require( '@stdlib/random/base/f' );\n*\n* var v = f( 5.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/f' ).factory;\n*\n* var f = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = f();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0, 1.3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, s, m ) {\n\tif ( !isPositiveNumber( alpha ) || isnan( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number and not NaN. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) || isnan( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', m ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} pseudorandom number\n*/\nfunction frechet( rand, alpha, s, m ) {\n\treturn m + ( s * ( pow( -ln( rand() ), -1.0/alpha ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar frechet0 = require( './frechet.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var frechet = factory( 1.0, 1.0, 0.8 );\n* var v = frechet();\n* // returns \n*\n* @example\n* var frechet = factory( 1.0, 1.0, -2.0, {\n* 'seed': 297\n* });\n* var v = frechet();\n* // returns \n*/\nfunction factory() {\n\tvar alpha;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar s;\n\tvar m;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\tm = arguments[ 2 ];\n\t\terr = validate( alpha, s, m );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = frechet2;\n\t} else {\n\t\tprng = frechet1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'frechet' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, s, m ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = frechet1();\n\t* // returns \n\t*/\n\tfunction frechet1() {\n\t\treturn frechet0( rand, alpha, s, m );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {number} m - location parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = frechet2( 2.0, 1.0, 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = frechet2( 1.0, 1.0, 0.5 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = frechet2( 1.0, 2.0, NaN );\n\t* // returns NaN\n\t*/\n\tfunction frechet2( alpha, s, m ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( s ) ||\n\t\t\tisnan( m ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn frechet0( rand, alpha, s, m );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @name frechet\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = frechet( 1.0, 1.0, 0.5 );\n* // returns \n*/\nvar frechet = factory();\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fr\u00E9chet distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/frechet\n*\n* @example\n* var frechet = require( '@stdlib/random/base/frechet' );\n*\n* var v = frechet( 10.0, 10.0, 7.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/frechet' ).factory;\n*\n* var frechet = factory( 5.0, 5.0, 3.0, {\n* 'seed': 643361677\n* });\n*\n* var v = frechet();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/frechet' ).factory;\n*\n* var frechet = factory({\n* 'seed': 643361677\n* });\n*\n* var v = frechet( 5.0, 5.0, 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, beta ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Gumbel distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction gumbel( rand, mu, beta ) {\n\treturn mu - ( beta*ln( -ln( rand() ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar gumbel0 = require( './gumbel.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Gumbel distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var gumbel = factory( 0.0, 1.0 );\n* var v = gumbel();\n* // returns \n*\n* @example\n* var gumbel = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = gumbel();\n* // returns \n*/\nfunction factory() {\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( mu, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = gumbel2;\n\t} else {\n\t\tprng = gumbel1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'gumbel' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Gumbel distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = gumbel1();\n\t* // returns \n\t*/\n\tfunction gumbel1() {\n\t\treturn gumbel0( rand, mu, beta );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = gumbel2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = gumbel2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction gumbel2( mu, beta ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( beta ) ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn gumbel0( rand, mu, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Gumbel distribution.\n*\n* @name gumbel\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = gumbel( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = gumbel( 0.0, -1.0 );\n* // returns NaN\n*/\nvar gumbel = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Gumbel distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/gumbel\n*\n* @example\n* var gumbel = require( '@stdlib/random/base/gumbel' );\n*\n* var v = gumbel( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gumbel' ).factory;\n*\n* var gumbel = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = gumbel();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gumbel' ).factory;\n*\n* var gumbel = factory({\n* 'seed': 297\n* });\n*\n* var v = gumbel( 2.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 2, 3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( N, K, n ) {\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\treturn new RangeError( format( 'invalid argument. Third argument must be less than or equal to the first argument. Value: `%u`.', n ) );\n\t}\n\tif ( K > N ) {\n\t\treturn new RangeError( format( 'invalid argument. Second argument must be less than or equal to the first argument. Value: `%u`.', K ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factorial = require( '@stdlib/math/base/special/factorial' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution using the HIN algorithm, which is based on an inverse transformation method.\n*\n* ## References\n*\n* - Fishman, George S. 1973. _Concepts and methods in discrete event digital simulation_. A Wiley-Interscience Publication. New York, NY, USA: Wiley.\n* - Kachitvichyanukul, Voratas., and Burce Schmeiser. 1985. \"Computer generation of hypergeometric random variates.\" _Journal of Statistical Computation and Simulation_ 22 (2): 127\u201345. doi:[10.1080/00949658508810839][@kachitvichyanukul:1985].\n*\n* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {NonNegativeInteger} n1 - number of successes in population\n* @param {NonNegativeInteger} n2 - number of failures in population\n* @param {NonNegativeInteger} k - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction hin( rand, n1, n2, k ) {\n\tvar p;\n\tvar u;\n\tvar x;\n\tif ( k < n2 ) {\n\t\tp = ( factorial( n2 ) * factorial( n1 + n2 - k ) ) /\n\t\t\t( factorial( n1 + n2 ) * factorial( n2 - k ) );\n\t\tx = 0;\n\t} else {\n\t\tp = ( factorial( n1 ) * factorial( k ) ) /\n\t\t\t( factorial( k - n2 ) * factorial( n1 + n2 ) );\n\t\tx = k - n2;\n\t}\n\tu = rand();\n\twhile ( u > p ) {\n\t\tu -= p;\n\t\tp *= ( n1 - x ) * ( k - x ) / ( ( x + 1 ) * ( n2 - k + 1 + x ) );\n\t\tx += 1;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hin = require( './hin.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution.\n*\n* ## References\n*\n* - Kachitvichyanukul, Voratas., and Burce Schmeiser. 1985. \"Computer generation of hypergeometric random variates.\" _Journal of Statistical Computation and Simulation_ 22 (2): 127\u201345. doi:[10.1080/00949658508810839][@kachitvichyanukul:1985].\n*\n* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction hypergeometric( rand, N, K, n ) {\n\tvar n1;\n\tvar n2;\n\tvar k;\n\tvar x;\n\n\tif ( n > N/2 ) {\n\t\tk = N - n;\n\t\tif ( 2*K <= N ) {\n\t\t\tn1 = K;\n\t\t\tn2 = N - K;\n\t\t\tx = hin( rand, n1, n2, k );\n\t\t\treturn K - x;\n\t\t}\n\t\tn2 = K;\n\t\tn1 = N - K;\n\t\tx = hin( rand, n1, n2, k );\n\t\treturn n - N + K + x;\n\t}\n\tk = n;\n\tif ( 2*K <= N ) {\n\t\tn1 = K;\n\t\tn2 = N - K;\n\t\tx = hin( rand, n1, n2, k );\n\t\treturn x;\n\t}\n\tn1 = N - K;\n\tn2 = K;\n\tx = hin( rand, n1, n2, k );\n\treturn n - x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar hypergeometric0 = require( './hypergeometric.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating hypergeometric distributed random numbers.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var hypergeometric = factory( 5, 3, 2 );\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var hypergeometric = factory( 10, 10, 10, {\n* 'seed': 297\n* });\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var hypergeometric = factory();\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar N;\n\tvar K;\n\tvar n;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tN = arguments[ 0 ];\n\t\tK = arguments[ 1 ];\n\t\tn = arguments[ 2 ];\n\t\terr = validate( N, K, n );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( N === void 0 ) {\n\t\tprng = hypergeometric2;\n\t} else {\n\t\tprng = hypergeometric1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'hypergeometric' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( N === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ N, K, n ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a hypergeometric distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = hypergeometric1();\n\t* // returns \n\t*/\n\tfunction hypergeometric1() {\n\t\treturn hypergeometric0( rand, N, K, n );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} N - population size\n\t* @param {NonNegativeInteger} K - subpopulation size\n\t* @param {NonNegativeInteger} n - number of draws\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = hypergeometric2( 5, 3, 2 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = hypergeometric2( NaN, NaN, NaN );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = hypergeometric2( 5.21, 3.14, 2.76 );\n\t* // returns NaN\n\t*/\n\tfunction hypergeometric2( N, K, n ) {\n\t\tif (\n\t\t\tN === PINF ||\n\t\t\tK === PINF ||\n\t\t\t!isNonNegativeInteger( N ) ||\n\t\t\t!isNonNegativeInteger( K ) ||\n\t\t\t!isNonNegativeInteger( n ) ||\n\t\t\tn > N\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn hypergeometric0( rand, N, K, n );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution.\n*\n* @name hypergeometric\n* @type {PRNG}\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*\n* @example\n* var v = hypergeometric( -5, 3, 2 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( 5, 3.14, 2 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( 5, 3, 1.5 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( NaN, NaN, NaN );\n* // returns NaN\n*/\nvar hypergeometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Hypergeometric distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/hypergeometric\n*\n* @example\n* var hypergeometric = require( '@stdlib/random/base/hypergeometric' );\n*\n* var v = hypergeometric( 10, 10, 10 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory( 5, 3, 2, {\n* 'seed': 297\n* });\n*\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory();\n*\n* var v = hypergeometric( 10, 2, 2 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory({\n* 'seed': 297\n* });\n*\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isPositive( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from Kumaraswamy's double bounded distribution.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator for uniformly distributed numbers\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( rand, a, b ) {\n\tvar u = rand();\n\treturn pow( 1.0 - pow( 1.0-u, 1.0/b ), 1.0/a );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar kumaraswamy0 = require( './kumaraswamy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Kumaraswamy's double bounded distributed random numbers.\n*\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var kumaraswamy = factory( 2.0, 1.0 );\n* var v = kumaraswamy();\n* // returns \n*\n* @example\n* var kumaraswamy = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = kumaraswamy();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = kumaraswamy2;\n\t} else {\n\t\tprng = kumaraswamy1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'kumaraswamy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a Kumaraswamy's double bounded distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta1();\n\t* // returns \n\t*/\n\tfunction kumaraswamy1() {\n\t\treturn kumaraswamy0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} a - first shape parameter\n\t* @param {PositiveNumber} b - second shape parameter\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = kumaraswamy2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction kumaraswamy2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta <= 0.0 ||\n\t\t\tb <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn kumaraswamy0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a Kumaraswamy's double bounded distributed random number.\n*\n* @name kumaraswamy\n* @type {PRNG}\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {Probability} pseudorandom number\n*\n* @example\n* var r = kumaraswamy( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = kumaraswamy( -2.0, 5.0 );\n* // returns NaN\n*/\nvar kumaraswamy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = kumaraswamy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Kumaraswamy's double bounded distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/kumaraswamy\n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/base/kumaraswamy' );\n*\n* var v = kumaraswamy( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/kumaraswamy' ).factory;\n*\n* var kumaraswamy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = kumaraswamy();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, b ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction laplace( rand, mu, b ) {\n\tvar u = rand() - 0.5;\n\treturn mu - ( b*sign( u )*ln( 1.0 - (2.0*abs(u)) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar laplace0 = require( './laplace.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Laplace (double exponential) distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var laplace = factory( 0.0, 1.0 );\n* var v = laplace();\n* // returns \n*\n* @example\n* var laplace = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = laplace();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( mu, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = laplace2;\n\t} else {\n\t\tprng = laplace1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'laplace' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = laplace1();\n\t* // returns \n\t*/\n\tfunction laplace1() {\n\t\treturn laplace0( rand, mu, b );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} b - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = laplace2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = laplace2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction laplace2( mu, b ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( b ) ||\n\t\t\tb <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn laplace0( rand, mu, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n*\n* @name laplace\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = laplace( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = laplace( 0.0, -1.0 );\n* // returns NaN\n*/\nvar laplace = factory();\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Laplace (double exponential) distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/laplace\n*\n* @example\n* var laplace = require( '@stdlib/random/base/laplace' );\n*\n* var v = laplace( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/laplace' ).factory;\n* var laplace = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = laplace();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/laplace' ).factory;\n* var laplace = factory({\n* 'seed': 297\n* });\n*\n* var v = laplace( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, c ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( c ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar normalQuantile = require( '@stdlib/stats/base/dists/normal/quantile' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction levy( rand, mu, c ) {\n\tvar z = normalQuantile( 1.0 - ( rand() / 2.0 ), 0.0, 1.0 );\n\treturn mu + ( c / ( z*z ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = levy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar levy0 = require( './levy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a L\u00E9vy distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var levy = factory( 0.0, 1.0 );\n* var v = levy();\n* // returns \n*\n* @example\n* var levy = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = levy();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar c;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tc = arguments[ 1 ];\n\t\terr = validate( mu, c );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = levy2;\n\t} else {\n\t\tprng = levy1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'levy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, c ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a L\u00E9vy distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = levy1();\n\t* // returns \n\t*/\n\tfunction levy1() {\n\t\treturn levy0( rand, mu, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} c - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = levy2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = levy2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction levy2( mu, c ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( c ) ||\n\t\t\tc <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn levy0( rand, mu, c );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n*\n* @name levy\n* @type {PRNG}\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = levy( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = levy( 0.0, -1.0 );\n* // returns NaN\n*/\nvar levy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = levy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* L\u00E9vy distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/levy\n*\n* @example\n* var levy = require( '@stdlib/random/base/levy' );\n*\n* var v = levy( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/levy' ).factory;\n* var levy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = levy();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/levy' ).factory;\n* var levy = factory({\n* 'seed': 297\n* });\n*\n* var v = levy( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, s ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a logistic distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction logistic( rand, mu, s ) {\n\tvar u = rand();\n\treturn mu + ( s*ln( u / (1.0-u) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar logistic0 = require( './logistic.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a logistic distribution.\n*\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var logistic = factory( 0.0, 1.0 );\n*\n* var v = logistic();\n* // returns \n*\n* @example\n* var logistic = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = logistic();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar s;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\terr = validate( mu, s );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = logistic2;\n\t} else {\n\t\tprng = logistic1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'logistic' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, s ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a logistic distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = logistic1();\n\t* // returns \n\t*/\n\tfunction logistic1() {\n\t\treturn logistic0( rand, mu, s );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = logistic2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = logistic2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction logistic2( mu, s ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( s ) ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn logistic0( rand, mu, s );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a logistic distribution.\n*\n* @name logistic\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = logistic( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = logistic( 0.0, -1.0 );\n* // returns NaN\n*/\nvar logistic = factory();\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Logistic distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/logistic\n*\n* @example\n* var logistic = require( '@stdlib/random/base/logistic' );\n*\n* var v = logistic( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/logistic' ).factory;\n* var logistic = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = logistic();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/logistic' ).factory;\n* var logistic = factory({\n* 'seed': 297\n* });\n*\n* var v = logistic( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar exp = require( '@stdlib/math/base/special/exp' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution.\n*\n* ## Notes\n*\n* - Appropriate for \\\\(lambda < 30\\\\).\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tvar p = rand();\n\tvar k = 1;\n\twhile ( p > exp( -lambda ) ) {\n\t\tk += 1;\n\t\tp *= rand();\n\t}\n\treturn k - 1;\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factorialln = require( '@stdlib/math/base/special/factorialln' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar LN_SQRT_TWO_PI = require( '@stdlib/constants/float64/ln-sqrt-two-pi' );\n\n\n// VARIABLES //\n\nvar ONE_12 = 1.0 / 12.0;\nvar ONE_360 = 1.0 / 360.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* ## References\n*\n* - H\u00F6rmann, W. 1993. \"The transformed rejection method for generating Poisson random variables.\" _Insurance: Mathematics and Economics_ 12 (1): 39\u201345. doi:[10.1016/0167-6687(93)90997-4][@hormann:1993b].\n*\n* [@hormann:1993b]: http://dx.doi.org/10.1016/0167-6687(93)90997-4\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tvar slambda;\n\tvar ainv;\n\tvar urvr;\n\tvar us;\n\tvar vr;\n\tvar a;\n\tvar b;\n\tvar k;\n\tvar u;\n\tvar v;\n\n\tslambda = sqrt( lambda );\n\n\tb = (2.53*slambda) + 0.931;\n\ta = (0.02483*b) - 0.059;\n\n\tainv = (1.1328/(b-3.4)) + 1.1239;\n\tvr = (-3.6224/(b-2.0)) + 0.9277;\n\turvr = 0.86 * vr;\n\n\twhile ( true ) {\n\t\tv = rand();\n\t\tif ( v <= urvr ) {\n\t\t\tu = (v / vr) - 0.43;\n\t\t\tu *= (2.0*a / (0.5-abs(u))) + b;\n\t\t\tu += lambda + 0.445;\n\t\t\treturn floor( u );\n\t\t}\n\t\tif ( v >= vr ) {\n\t\t\tu = rand() - 0.5;\n\t\t} else {\n\t\t\tu = (v / vr) - 0.93;\n\t\t\tu = (sign( u )*0.5) - u;\n\t\t\tv = vr * rand();\n\t\t}\n\t\tus = 0.5 - abs( u );\n\t\tif (\n\t\t\tus >= 0.013 ||\n\t\t\tus >= v\n\t\t) {\n\t\t\tk = floor( (((2.0*a/us) + b)*u) + lambda + 0.445 );\n\t\t\tv *= ainv / ( (a/(us*us)) + b );\n\t\t\tu = (k+0.5) * ln( lambda/k );\n\t\t\tu += -lambda - LN_SQRT_TWO_PI + k;\n\t\t\tu -= ( ONE_12 - (ONE_360/(k*k)) ) / k;\n\t\t\tif (\n\t\t\t\tk >= 10 &&\n\t\t\t\tu >= ln( v*slambda )\n\t\t\t) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tu = (k*ln( lambda )) - lambda - factorialln( k );\n\t\t\tif (\n\t\t\t\tk >= 0 &&\n\t\t\t\tk <= 9 &&\n\t\t\t\tu >= ln( v )\n\t\t\t) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar knuth = require( './knuth.js' );\nvar rejection = require( './rejection.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tif ( lambda < 30.0 ) {\n\t\treturn knuth( rand, lambda );\n\t}\n\treturn rejection( rand, lambda );\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar poisson0 = require( './poisson.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Poisson distributed random numbers.\n*\n* @param {PositiveNumber} [lambda] - mean\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var poisson = factory( 5.0 );\n* var v = poisson();\n* // returns \n*\n* @example\n* var poisson = factory( 8.0, {\n* 'seed': 297\n* });\n* var v = poisson();\n* // returns \n*\n* @example\n* var poisson = factory();\n* var v = poisson( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tlambda = arguments[ 0 ];\n\t\tif ( !isPositive( lambda ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = poisson2;\n\t} else {\n\t\tprng = poisson1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'poisson' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( lambda === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = poisson1();\n\t* // returns \n\t*/\n\tfunction poisson1() {\n\t\treturn poisson0( rand, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - mean\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = poisson2( 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = poisson2( NaN );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = poisson2( -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction poisson2( lambda ) {\n\t\tif (\n\t\t\tisnan( lambda ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn poisson0( rand, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* ## Method\n*\n* - When \\\\(\\lambda < 30\\\\), use Knuth's method.\n* - When \\\\(lambda \\geq 30\\\\), use transformed rejection method as Knuth's method does not scale well with \\\\(\\lambda\\\\).\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n* - H\u00F6rmann, W. 1993. \"The transformed rejection method for generating Poisson random variables.\" _Insurance: Mathematics and Economics_ 12 (1): 39\u201345. doi:[10.1016/0167-6687(93)90997-4][@hormann:1993b].\n*\n* [@hormann:1993b]: http://dx.doi.org/10.1016/0167-6687(93)90997-4\n*\n* @name poisson\n* @type {PRNG}\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = poisson( 0.5 );\n* // returns \n*\n* @example\n* var v = poisson( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = poisson( NaN );\n* // returns NaN\n*/\nvar poisson = factory();\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Poisson distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/poisson\n*\n* @example\n* var poisson = require( '@stdlib/random/base/poisson' );\n*\n* var v = poisson( 4.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/poisson' ).factory;\n* var poisson = factory( 4.0, {\n* 'seed': 297\n* });\n*\n* var v = poisson();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/poisson' ).factory;\n* var poisson = factory({\n* 'seed': 297\n* });\n*\n* var v = poisson( 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {number} p - success probability\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 10, 0.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( r, p ) {\n\tif ( !isPositive( r ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', r ) );\n\t}\n\tif ( !isNumber( p ) || isnan( p ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', p ) );\n\t}\n\tif ( p <= 0.0 || p >= 1.0 ) {\n\t\treturn new RangeError( format( 'invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.', p ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar poisson = require( './../../../base/poisson' ).factory;\nvar gamma = require( './../../../base/gamma' ).factory;\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating negative binomial distributed random numbers.\n*\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {number} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be number\n* @throws {RangeError} `p` must be a number on the interval `(0,1)`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var negativeBinomial = factory( 10, 0.5 );\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var negativeBinomial = factory( 10, 0.8, {\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var negativeBinomial = factory();\n*\n* var v = negativeBinomial( 10, 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar STATE;\n\tvar rpois;\n\tvar opts;\n\tvar prng;\n\tvar rand;\n\tvar FLG;\n\tvar err;\n\tvar p;\n\tvar r;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trpois = poisson( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trpois = poisson({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trpois = poisson( opts );\n\t\t}\n\t} else {\n\t\tr = arguments[ 0 ];\n\t\tp = arguments[ 1 ];\n\t\terr = validate( r, p );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trpois = poisson({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trpois = poisson( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trpois = poisson( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\tif ( r === void 0 ) {\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( r, p/(1-p), {\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rpois.state;\n\t\t\trpois.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\tif ( r === void 0 ) {\n\t\t\trgamma = gamma({\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( r, p/(1-p), {\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t}\n\t}\n\tif ( r === void 0 ) {\n\t\tprng = negativeBinomial2;\n\t} else {\n\t\tprng = negativeBinomial1;\n\t}\n\trand = rpois.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'negative-binomial' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( r === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ r, p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a negative binomial distribution with bound parameters `r` and `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = negativeBinomial1();\n\t* // returns \n\t*/\n\tfunction negativeBinomial1() {\n\t\treturn rpois( rgamma() );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a negative binomial distribution with parameters `r` and `p`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} r - number of successes until experiment is stopped\n\t* @param {number} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = negativeBinomial2( 10, 0.5 );\n\t* // returns \n\t*/\n\tfunction negativeBinomial2( r, p ) {\n\t\tif (\n\t\t\tisnan( r ) ||\n\t\t\tisnan( p ) ||\n\t\t\tp <= 0.0 ||\n\t\t\tp >= 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rpois( rgamma( r, p/(1-p) ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a negative binomial distribution.\n*\n* @name negativeBinomial\n* @type {PRNG}\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {number} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = negativeBinomial( 10, 0.5 );\n* // returns \n*/\nvar negativeBinomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = negativeBinomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Negative binomial distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/negative-binomial\n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/base/negative-binomial' );\n*\n* var v = negativeBinomial( 20, 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/negative-binomial' ).factory;\n* var negativeBinomial = factory( 10, 0.3, {\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/negative-binomial' ).factory;\n* var negativeBinomial = factory({\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial( 10, 0.67 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction pareto( rand, alpha, beta ) {\n\treturn beta / pow( rand(), 1.0/alpha );\n}\n\n\n// EXPORTS //\n\nmodule.exports = pareto;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar pareto0 = require( './pareto.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Pareto (Type I) distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var pareto1 = factory( 2.0, 1.0 );\n*\n* var v = pareto1();\n* // returns \n*\n* @example\n* var pareto1 = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = pareto1();\n* // returns \n*/\nfunction factory() {\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = pareto2;\n\t} else {\n\t\tprng = pareto1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'pareto-type1' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Pareto (Type I) distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = pareto1();\n\t* // returns \n\t*/\n\tfunction pareto1() {\n\t\treturn pareto0( rand, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = pareto2( 2.0, 3.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = pareto2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = pareto2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = pareto2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction pareto2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn pareto0( rand, alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n*\n* @name pareto1\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = pareto1( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var v = pareto1( -2.0, 3.0 );\n* // returns NaN\n*/\nvar pareto1 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = pareto1;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Pareto (Type I) distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/pareto-type1\n*\n* @example\n* var pareto1 = require( '@stdlib/random/base/pareto-type1' );\n*\n* var v = pareto1( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/pareto-type1' ).factory;\n* var pareto1 = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = pareto1();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/pareto-type1' ).factory;\n* var pareto1 = factory({\n* 'seed': 297\n* });\n*\n* var v = pareto1( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"name\": \"mt19937\",\n\t\"copy\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar minstd = require( './../../../base/minstd' );\nvar minstdShuffle = require( './../../../base/minstd-shuffle' );\nvar mt19937 = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'minstd' ] = minstd;\nprngs[ 'minstd-shuffle' ] = minstdShuffle;\nprngs[ 'mt19937' ] = mt19937;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers having integer values.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of pseudorandom number generator\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randi = factory();\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'name': 'minstd'\n* });\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'seed': 12345\n* });\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n* var v = randi();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( opts.seed === void 0 ) {\n\t\t\trand = prng.factory();\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'seed': opts.seed\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'state': opts.state,\n\t\t\t'copy': opts.copy\n\t\t});\n\t}\n\tsetReadOnly( randi, 'NAME', 'randi' );\n\tsetReadOnlyAccessor( randi, 'seed', getSeed );\n\tsetReadOnlyAccessor( randi, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( randi, 'state', getState, setState );\n\tsetReadOnlyAccessor( randi, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( randi, 'byteLength', getStateSize );\n\tsetReadOnly( randi, 'toJSON', toJSON );\n\tsetReadOnly( randi, 'PRNG', rand );\n\tsetReadOnly( randi, 'MIN', rand.MIN );\n\tsetReadOnly( randi, 'MAX', rand.MAX );\n\n\treturn randi;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = randi.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number having an integer value.\n\t*\n\t* @private\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = randi();\n\t* // returns \n\t*/\n\tfunction randi() {\n\t\treturn rand();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number having an integer value.\n*\n* @name randi\n* @type {PRNG}\n* @returns {integer} pseudorandom number\n*\n* @example\n* var v = randi();\n* // returns \n*/\nvar randi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/base/randi\n*\n* @example\n* var randi = require( '@stdlib/random/base/randi' );\n*\n* var v = randi();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randi' ).factory;\n*\n* var randi = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n*\n* var v = randi();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"name\": \"improved-ziggurat\",\n\t\"copy\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar boxMuller = require( './../../../base/box-muller' );\nvar improvedZiggurat = require( './../../../base/improved-ziggurat' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'box-muller' ] = boxMuller;\nprngs[ 'improved-ziggurat' ] = improvedZiggurat;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar format = require( '@stdlib/string/format' );\nvar noop = require( '@stdlib/utils/noop' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for numbers from a standard normal distribution.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='improved-ziggurat'] - name of pseudorandom number generator\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'name': 'box-muller'\n* });\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'seed': 12345\n* });\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'name': 'box-muller',\n* 'seed': 12345\n* });\n* var v = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\t\topts.prng = options.prng;\n\t\t\tif ( opts.prng === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.prng === void 0 ) {\n\t\tif ( opts.state === void 0 ) {\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\trand = prng.factory();\n\t\t\t} else {\n\t\t\t\trand = prng.factory({\n\t\t\t\t\t'seed': opts.seed\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'state': opts.state,\n\t\t\t\t'copy': opts.copy\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'prng': opts.prng\n\t\t});\n\t}\n\tsetReadOnly( normal, 'NAME', 'randn' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts.prng ) {\n\t\tsetReadOnly( normal, 'seed', null );\n\t\tsetReadOnly( normal, 'seedLength', null );\n\t\tsetReadWriteAccessor( normal, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( normal, 'stateLength', null );\n\t\tsetReadOnly( normal, 'byteLength', null );\n\t\tsetReadOnly( normal, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( normal, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( normal, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( normal, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( normal, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( normal, 'byteLength', getStateSize );\n\t\tsetReadOnly( normal, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( normal, 'PRNG', rand.PRNG );\n\treturn normal;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = normal.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a standard normal distribution.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal();\n\t* // returns \n\t*/\n\tfunction normal() {\n\t\treturn rand();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a standard normal random number.\n*\n* @name normal\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = normal();\n* // returns \n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Standard normal pseudorandom numbers.\n*\n* @module @stdlib/random/base/randn\n*\n* @example\n* var randn = require( '@stdlib/random/base/randn' );\n*\n* var v = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randn' ).factory;\n*\n* var randn = factory({\n* 'name': 'box-muller',\n* 'seed': 12345\n* });\n*\n* var v = randn();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number from a Rayleigh distribution with scale parameter `sigma`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction rayleigh( rand, sigma ) {\n\treturn sigma * sqrt( -2.0*ln( rand() ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar rayleigh0 = require( './rayleigh.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Rayleigh distributed random numbers.\n*\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var rayleigh = factory( 1.0 );\n*\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var rayleigh = factory( 0.5, {\n* 'seed': 297\n* });\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var rayleigh = factory();\n* var v = rayleigh( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tsigma = arguments[ 0 ];\n\t\tif ( !isPositive( sigma ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( sigma === void 0 ) {\n\t\tprng = rayleigh2;\n\t} else {\n\t\tprng = rayleigh1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'rayleigh' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( sigma === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a Rayleigh distribution with bound scale parameter `sigma`.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = rayleigh1();\n\t* // returns \n\t*/\n\tfunction rayleigh1() {\n\t\treturn rayleigh0( rand, sigma );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a Rayleigh distribution with scale parameter `sigma`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = rayleigh2( 3.0 );\n\t* // returns \n\t*/\n\tfunction rayleigh2( sigma ) {\n\t\tif (\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rayleigh0( rand, sigma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Rayleigh distribution with scale parameter `sigma`.\n*\n* @name rayleigh\n* @type {Function}\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = rayleigh( 3.0 );\n* // returns \n*\n* @example\n* var v = rayleigh( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = rayleigh( NaN );\n* // returns NaN\n*/\nvar rayleigh = factory();\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Rayleigh distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/rayleigh\n*\n* @example\n* var rayleigh = require( '@stdlib/random/base/rayleigh' );\n*\n* var v = rayleigh( 2.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/rayleigh' ).factory;\n* var rayleigh = factory( 3.0, {\n* 'seed': 297\n* });\n*\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/rayleigh' ).factory;\n* var rayleigh = factory({\n* 'seed': 297\n* });\n*\n* var v = rayleigh( 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating t-distributed random numbers.\n*\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var t = factory( 1.0 );\n*\n* var v = t();\n* // returns \n*\n* @example\n* var t = factory( 0.5, {\n* 'seed': 297\n* });\n* var v = t();\n* // returns \n*\n* @example\n* var t = factory();\n* var v = t( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar STATE;\n\tvar rnorm;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar FLG;\n\tvar v;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trnorm = randn( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\tif ( isObject( arguments[ 0 ] ) ) {\n\t\t\topts = arguments[ 0 ];\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\tv = arguments[ 0 ];\n\t\t\tif ( !isPositive( v ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number or an options object. Value: `%s`.', v ) );\n\t\t\t}\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tv = arguments[ 0 ];\n\t\tif ( !isPositive( v ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t\t}\n\t\topts = arguments[ 1 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trnorm = randn( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\tif ( v === void 0 ) {\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( v, {\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rnorm.state;\n\t\t\trnorm.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\tif ( v === void 0 ) {\n\t\t\trchisq = chisquare({\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( v, {\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t}\n\t}\n\tif ( v === void 0 ) {\n\t\tprng = t2;\n\t} else {\n\t\tprng = t1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 't' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( v === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ v ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Student's t-distribution with bound degrees of freedom `v`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = t1();\n\t* // returns \n\t*/\n\tfunction t1() {\n\t\treturn rnorm() / sqrt( rchisq() / v );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Student's t-distribution with degrees of freedom `v`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} v - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = t2( 3.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = t2( 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = t2( -1.5 );\n\t* // returns NaN\n\t*/\n\tfunction t2( v ) {\n\t\tif (\n\t\t\tisnan( v ) ||\n\t\t\tv <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rnorm() / sqrt( rchisq( v ) / v );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Student's t-distribution with degrees of freedom `v`.\n*\n* @name t\n* @type {PRNG}\n* @param {PositiveNumber} v - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = t( 3.0 );\n* // returns \n*\n* @example\n* var v = t( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = t( NaN );\n* // returns NaN\n*/\nvar t = factory();\n\n\n// EXPORTS //\n\nmodule.exports = t;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Student's t-distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/t\n*\n* @example\n* var t = require( '@stdlib/random/base/t' );\n*\n* var v = t( 2.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/t' ).factory;\n* var t = factory( 3.0, {\n* 'seed': 297\n* });\n*\n* var v = t();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/t' ).factory;\n* var t = factory({\n* 'seed': 297\n* });\n*\n* var v = t( 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0, 1.3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b, c ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\treturn new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b` and mode `c`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {number} pseudorandom number\n*/\nfunction triangular( rand, a, b, c ) {\n\tvar fc;\n\tvar x;\n\tvar u;\n\tfc = (c - a) / (b - a);\n\tu = rand();\n\tif ( u < fc ) {\n\t\tx = (b - a) * (c - a);\n\t\treturn a + sqrt( x * u );\n\t}\n\tx = (b - a) * (b - c);\n\treturn b - sqrt( x * (1.0 - u) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar triangular0 = require( './triangular.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers drawn from a triangular distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var triangular = factory( 0.0, 1.0, 0.8 );\n*\n* var v = triangular();\n* // returns \n*\n* @example\n* var triangular = factory( -3.0, -1.0, -2.0, {\n* 'seed': 297\n* });\n* var v = triangular();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\tvar c;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\tc = arguments[ 2 ];\n\t\terr = validate( a, b, c );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = triangular2;\n\t} else {\n\t\tprng = triangular1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'triangular' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b, c ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a triangular distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = triangular1();\n\t* // returns \n\t*/\n\tfunction triangular1() {\n\t\treturn triangular0( rand, a, b, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b`, and mode `c`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {number} c - mode\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = triangular2( 0.0, 1.0, 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = triangular2( 1.0, 0.0, 0.5 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = triangular2( 1.0, 2.0, NaN );\n\t* // returns NaN\n\t*/\n\tfunction triangular2( a, b, c ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\tisnan( c ) ||\n\t\t\t!(a <= c && c <= b)\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn triangular0( rand, a, b, c );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b`, and mode `c`.\n*\n* @name triangular\n* @type {PRNG}\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = triangular( 0.0, 1.0, 0.5 );\n* // returns \n*/\nvar triangular = factory();\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Triangular distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/triangular\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var v = triangular( 0.0, 10.0, 7.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/triangular' ).factory;\n* var triangular = factory( -5.0, 5.0, 3.0, {\n* 'seed': 297\n* });\n*\n* var v = triangular();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/triangular' ).factory;\n* var triangular = factory({\n* 'seed': 297\n* });\n*\n* var v = triangular( -5.0, 5.0, 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( k, lambda ) {\n\tif ( !isPositive( k ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Scale parameter must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositive( lambda ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Shape parameter must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Weibull distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction weibull( rand, k, lambda ) {\n\treturn lambda * pow( -ln( 1.0-rand() ), 1.0/k );\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar weibull0 = require( './weibull.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Weibull distributed random numbers.\n*\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var weibull = factory( 2.0, 1.0 );\n*\n* var v = weibull();\n* // returns \n*\n* @example\n* var weibull = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = weibull();\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar k;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tlambda = arguments[ 1 ];\n\t\terr = validate( lambda, k );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = weibull2;\n\t} else {\n\t\tprng = weibull1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'weibull' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k, lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = weibull1();\n\t* // returns \n\t*/\n\tfunction weibull1() {\n\t\treturn weibull0( rand, k, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - scale parameter\n\t* @param {PositiveNumber} lambda - shape parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = weibull2( 2.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = weibull2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = weibull2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = weibull2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction weibull2( k, lambda ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tisnan( lambda ) ||\n\t\t\tk <= 0.0 ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn weibull0( rand, k, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Weibull distribution.\n*\n* @name weibull\n* @type {PRNG}\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var v = weibull( -2.0, 3.0 );\n* // returns NaN\n*/\nvar weibull = factory();\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Weibull distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/weibull\n*\n* @example\n* var weibull = require( '@stdlib/random/base/weibull' );\n*\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/weibull' ).factory;\n* var weibull = factory( 2.0, 3.0, {\n* 'seed': 297\n* });\n*\n* var v = weibull();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/weibull' ).factory;\n* var weibull = factory({\n* 'seed': 297\n* });\n*\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n// This file is generated using `scripts/build.js`.\n\n'use strict';\n\n// MODULES //\n\nvar prng0 = require( './../../../base/arcsine' );\nvar prng1 = require( './../../../base/bernoulli' );\nvar prng2 = require( './../../../base/beta' );\nvar prng3 = require( './../../../base/betaprime' );\nvar prng4 = require( './../../../base/binomial' );\nvar prng5 = require( './../../../base/box-muller' );\nvar prng6 = require( './../../../base/cauchy' );\nvar prng7 = require( './../../../base/chi' );\nvar prng8 = require( './../../../base/chisquare' );\nvar prng9 = require( './../../../base/cosine' );\nvar prng10 = require( './../../../base/discrete-uniform' );\nvar prng11 = require( './../../../base/erlang' );\nvar prng12 = require( './../../../base/exponential' );\nvar prng13 = require( './../../../base/f' );\nvar prng14 = require( './../../../base/frechet' );\nvar prng15 = require( './../../../base/gamma' );\nvar prng16 = require( './../../../base/geometric' );\nvar prng17 = require( './../../../base/gumbel' );\nvar prng18 = require( './../../../base/hypergeometric' );\nvar prng19 = require( './../../../base/improved-ziggurat' );\nvar prng20 = require( './../../../base/invgamma' );\nvar prng21 = require( './../../../base/kumaraswamy' );\nvar prng22 = require( './../../../base/laplace' );\nvar prng23 = require( './../../../base/levy' );\nvar prng24 = require( './../../../base/logistic' );\nvar prng25 = require( './../../../base/lognormal' );\nvar prng26 = require( './../../../base/minstd' );\nvar prng27 = require( './../../../base/minstd-shuffle' );\nvar prng28 = require( './../../../base/mt19937' );\nvar prng29 = require( './../../../base/negative-binomial' );\nvar prng30 = require( './../../../base/normal' );\nvar prng31 = require( './../../../base/pareto-type1' );\nvar prng32 = require( './../../../base/poisson' );\nvar prng33 = require( './../../../base/randi' );\nvar prng34 = require( './../../../base/randn' );\nvar prng35 = require( './../../../base/randu' );\nvar prng36 = require( './../../../base/rayleigh' );\nvar prng37 = require( './../../../base/t' );\nvar prng38 = require( './../../../base/triangular' );\nvar prng39 = require( './../../../base/uniform' );\nvar prng40 = require( './../../../base/weibull' );\n\n\n// MAIN //\n\nvar prngs = {};\nprngs[ 'arcsine' ] = prng0.factory;\nprngs[ 'bernoulli' ] = prng1.factory;\nprngs[ 'beta' ] = prng2.factory;\nprngs[ 'betaprime' ] = prng3.factory;\nprngs[ 'binomial' ] = prng4.factory;\nprngs[ 'box-muller' ] = prng5.factory;\nprngs[ 'cauchy' ] = prng6.factory;\nprngs[ 'chi' ] = prng7.factory;\nprngs[ 'chisquare' ] = prng8.factory;\nprngs[ 'cosine' ] = prng9.factory;\nprngs[ 'discrete-uniform' ] = prng10.factory;\nprngs[ 'erlang' ] = prng11.factory;\nprngs[ 'exponential' ] = prng12.factory;\nprngs[ 'f' ] = prng13.factory;\nprngs[ 'frechet' ] = prng14.factory;\nprngs[ 'gamma' ] = prng15.factory;\nprngs[ 'geometric' ] = prng16.factory;\nprngs[ 'gumbel' ] = prng17.factory;\nprngs[ 'hypergeometric' ] = prng18.factory;\nprngs[ 'improved-ziggurat' ] = prng19.factory;\nprngs[ 'invgamma' ] = prng20.factory;\nprngs[ 'kumaraswamy' ] = prng21.factory;\nprngs[ 'laplace' ] = prng22.factory;\nprngs[ 'levy' ] = prng23.factory;\nprngs[ 'logistic' ] = prng24.factory;\nprngs[ 'lognormal' ] = prng25.factory;\nprngs[ 'minstd' ] = prng26.factory;\nprngs[ 'minstd-shuffle' ] = prng27.factory;\nprngs[ 'mt19937' ] = prng28.factory;\nprngs[ 'negative-binomial' ] = prng29.factory;\nprngs[ 'normal' ] = prng30.factory;\nprngs[ 'pareto-type1' ] = prng31.factory;\nprngs[ 'poisson' ] = prng32.factory;\nprngs[ 'randi' ] = prng33.factory;\nprngs[ 'randn' ] = prng34.factory;\nprngs[ 'randu' ] = prng35.factory;\nprngs[ 'rayleigh' ] = prng36.factory;\nprngs[ 't' ] = prng37.factory;\nprngs[ 'triangular' ] = prng38.factory;\nprngs[ 'uniform' ] = prng39.factory;\nprngs[ 'weibull' ] = prng40.factory;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar contains = require( '@stdlib/assert/contains' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar table = require( './prngs.js' );\n\n\n// VARIABLES //\n\nvar TYPED_ARRAY_CTORS = {\n\t'Int32Array': Int32Array,\n\t'Uint32Array': Uint32Array\n};\nvar PRNG_WRAPPERS = [ 'randi', 'randn', 'randu' ];\n\n\n// MAIN //\n\n/**\n* Revives a JSON-serialized pseudorandom number generator.\n*\n* @param {string} key - key\n* @param {*} value - value\n* @returns {(*|Function)} value or PRNG\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n*\n* var str = JSON.stringify( mt19937 );\n* var rand = parseJSON( str, reviveBasePRNG );\n* // returns \n*/\nfunction reviveBasePRNG( key, value ) {\n\tvar factory;\n\tvar opts;\n\tvar args;\n\tvar ctor;\n\tvar tmp;\n\tif (\n\t\tvalue &&\n\t\tvalue.type === 'PRNG' &&\n\t\tisString( value.name ) &&\n\t\tisObject( value.state ) &&\n\t\tisArray( value.params ) &&\n\t\tisString( value.state.type ) &&\n\t\tisArray( value.state.data )\n\t) {\n\t\topts = {};\n\t\tfactory = table[ value.name ];\n\t\tif ( factory === void 0 ) {\n\t\t\ttmp = value.name.split( '-' );\n\t\t\tif ( contains( PRNG_WRAPPERS, tmp[ 0 ] ) ) {\n\t\t\t\tfactory = table[ tmp[ 0 ] ];\n\t\t\t\topts.name = tmp.slice( 1 ).join( '-' );\n\t\t\t}\n\t\t}\n\t\tif ( factory ) {\n\t\t\tctor = TYPED_ARRAY_CTORS[ value.state.type ];\n\t\t\tif ( ctor ) {\n\t\t\t\topts.state = new ctor( value.state.data );\n\n\t\t\t\targs = value.params.slice();\n\t\t\t\targs.push( opts );\n\n\t\t\t\ttry {\n\t\t\t\t\treturn factory.apply( null, args );\n\t\t\t\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\t\t\t\t// Return the original JSON value...\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reviveBasePRNG;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Revive a JSON-serialized pseudorandom generator.\n*\n* @module @stdlib/random/base/reviver\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n* var reviveBasePRNG = require( '@stdlib/random/base/reviver' );\n*\n* var str = JSON.stringify( mt19937 );\n* var rand = parseJSON( str, reviveBasePRNG );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace random\n*/\nvar random = {};\n\n/**\n* @name arcsine\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/arcsine}\n*/\nsetReadOnly( random, 'arcsine', require( './../../base/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/bernoulli}\n*/\nsetReadOnly( random, 'bernoulli', require( './../../base/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/beta}\n*/\nsetReadOnly( random, 'beta', require( './../../base/beta' ) );\n\n/**\n* @name betaprime\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/betaprime}\n*/\nsetReadOnly( random, 'betaprime', require( './../../base/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/binomial}\n*/\nsetReadOnly( random, 'binomial', require( './../../base/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/box-muller}\n*/\nsetReadOnly( random, 'boxMuller', require( './../../base/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/cauchy}\n*/\nsetReadOnly( random, 'cauchy', require( './../../base/cauchy' ) );\n\n/**\n* @name chi\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/chi}\n*/\nsetReadOnly( random, 'chi', require( './../../base/chi' ) );\n\n/**\n* @name chisquare\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/chisquare}\n*/\nsetReadOnly( random, 'chisquare', require( './../../base/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/cosine}\n*/\nsetReadOnly( random, 'cosine', require( './../../base/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/discrete-uniform}\n*/\nsetReadOnly( random, 'discreteUniform', require( './../../base/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/erlang}\n*/\nsetReadOnly( random, 'erlang', require( './../../base/erlang' ) );\n\n/**\n* @name exponential\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/exponential}\n*/\nsetReadOnly( random, 'exponential', require( './../../base/exponential' ) );\n\n/**\n* @name f\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/f}\n*/\nsetReadOnly( random, 'f', require( './../../base/f' ) );\n\n/**\n* @name frechet\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/frechet}\n*/\nsetReadOnly( random, 'frechet', require( './../../base/frechet' ) );\n\n/**\n* @name gamma\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/gamma}\n*/\nsetReadOnly( random, 'gamma', require( './../../base/gamma' ) );\n\n/**\n* @name geometric\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/geometric}\n*/\nsetReadOnly( random, 'geometric', require( './../../base/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/gumbel}\n*/\nsetReadOnly( random, 'gumbel', require( './../../base/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/hypergeometric}\n*/\n\nsetReadOnly( random, 'hypergeometric', require( './../../base/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/improved-ziggurat}\n*/\nsetReadOnly( random, 'improvedZiggurat', require( './../../base/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/invgamma}\n*/\nsetReadOnly( random, 'invgamma', require( './../../base/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/kumaraswamy}\n*/\nsetReadOnly( random, 'kumaraswamy', require( './../../base/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/laplace}\n*/\nsetReadOnly( random, 'laplace', require( './../../base/laplace' ) );\n\n/**\n* @name levy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/levy}\n*/\nsetReadOnly( random, 'levy', require( './../../base/levy' ) );\n\n/**\n* @name logistic\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/logistic}\n*/\nsetReadOnly( random, 'logistic', require( './../../base/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/lognormal}\n*/\nsetReadOnly( random, 'lognormal', require( './../../base/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/minstd}\n*/\nsetReadOnly( random, 'minstd', require( './../../base/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/minstd-shuffle}\n*/\nsetReadOnly( random, 'minstdShuffle', require( './../../base/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/mt19937}\n*/\nsetReadOnly( random, 'mt19937', require( './../../base/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/negative-binomial}\n*/\nsetReadOnly( random, 'negativeBinomial', require( './../../base/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/normal}\n*/\nsetReadOnly( random, 'normal', require( './../../base/normal' ) );\n\n/**\n* @name pareto1\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/pareto-type1}\n*/\nsetReadOnly( random, 'pareto1', require( './../../base/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/poisson}\n*/\nsetReadOnly( random, 'poisson', require( './../../base/poisson' ) );\n\n/**\n* @name randi\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randi}\n*/\nsetReadOnly( random, 'randi', require( './../../base/randi' ) );\n\n/**\n* @name randn\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randn}\n*/\nsetReadOnly( random, 'randn', require( './../../base/randn' ) );\n\n/**\n* @name randu\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randu}\n*/\nsetReadOnly( random, 'randu', require( './../../base/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/rayleigh}\n*/\nsetReadOnly( random, 'rayleigh', require( './../../base/rayleigh' ) );\n\n/**\n* @name reviveBasePRNG\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/reviver}\n*/\nsetReadOnly( random, 'reviveBasePRNG', require( './../../base/reviver' ) );\n\n/**\n* @name t\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/t}\n*/\nsetReadOnly( random, 't', require( './../../base/t' ) );\n\n/**\n* @name triangular\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/triangular}\n*/\nsetReadOnly( random, 'triangular', require( './../../base/triangular' ) );\n\n/**\n* @name uniform\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/uniform}\n*/\nsetReadOnly( random, 'uniform', require( './../../base/uniform' ) );\n\n/**\n* @name weibull\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/weibull}\n*/\nsetReadOnly( random, 'weibull', require( './../../base/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rarcsine = require( './../../../base/arcsine' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rarcsine( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rarcsine( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/iter/arcsine\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/arcsine' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbern = require( './../../../base/bernoulli' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbern( p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbern( p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/iter/bernoulli\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/bernoulli' );\n*\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbeta = require( './../../../base/beta' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbeta( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbeta( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/iter/beta\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/beta' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbetaprime = require( './../../../base/betaprime' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbetaprime( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbetaprime( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/iter/betaprime\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/betaprime' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbinom = require( './../../../base/binomial' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive integer\n* @throws {TypeError} second argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 8, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( n, p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbinom( n, p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbinom( n, p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( n, p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/iter/binomial\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/binomial' );\n*\n* var iter = iterator( 10, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/box-muller' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @module @stdlib/random/iter/box-muller\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/box-muller' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rcauchy = require( './../../../base/cauchy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( x0, gamma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositive( gamma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rcauchy( x0, gamma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rcauchy( x0, gamma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( x0, gamma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/iter/cauchy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/cauchy' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rchi = require( './../../../base/chi' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rchi( k, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rchi( k );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/iter/chi\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/chi' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rchisq = require( './../../../base/chisquare' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rchisq( k, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rchisq( k );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/iter/chisquare\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/chisquare' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rcosine = require( './../../../base/cosine' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, s, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rcosine( mu, s, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rcosine( mu, s );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/iter/cosine\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/cosine' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isInteger = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar runif = require( './../../../base/discrete-uniform' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2, 6 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isInteger( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d,%d]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = runif( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = runif( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/iter/discrete-uniform\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/discrete-uniform' );\n*\n* var iter = iterator( -1, 2 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rerlang = require( './../../../base/erlang' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveInteger( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rerlang( k, lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rerlang( k, lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/iter/erlang\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/erlang' );\n*\n* var iter = iterator( 2, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rexp = require( './../../../base/exponential' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rexp( lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rexp( lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/iter/exponential\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/exponential' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rf = require( './../../../base/f' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( d1, d2, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( d1 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositiveNumber( d2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rf( d1, d2, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rf( d1, d2 );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( d1, d2, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/iter/f\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/f' );\n*\n* var iter = iterator( 2.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rfrechet = require( './../../../base/frechet' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - rate parameter\n* @param {number} m - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, s, m, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number. Value: `%s`.', m ) );\n\t}\n\tif ( arguments.length > 3 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rfrechet( alpha, s, m, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rfrechet( alpha, s, m );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, s, m, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/iter/frechet\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/frechet' );\n*\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgamma = require( './../../../base/gamma' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgamma( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgamma( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/iter/gamma\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/gamma' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgeom = require( './../../../base/geometric' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgeom( p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgeom( p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/iter/geometric\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/geometric' );\n*\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgumbel = require( './../../../base/gumbel' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a number\n* @throws {TypeError} second argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgumbel( mu, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgumbel( mu, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/iter/gumbel\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/gumbel' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rhypergeom = require( './../../../base/hypergeometric' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} third argument must be a nonnegative integer\n* @throws {RangeError} number of draws must be less than or equal to the population size\n* @throws {RangeError} subpopulation size must be less than or equal to the population size\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 10, 5, 3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( N, K, n, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.', n ) );\n\t}\n\tif ( K > N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.', K ) );\n\t}\n\tif ( arguments.length > 3 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rhypergeom( N, K, n, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rhypergeom( N, K, n );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( N, K, n, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/iter/hypergeometric\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/hypergeometric' );\n*\n* var iter = iterator( 10, 5, 6 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/improved-ziggurat' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @module @stdlib/random/iter/improved-ziggurat\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/improved-ziggurat' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rinvgamma = require( './../../../base/invgamma' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rinvgamma( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rinvgamma( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/iter/invgamma\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/invgamma' );\n*\n* var iter = iterator( 2.0, 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rkumaraswamy = require( './../../../base/kumaraswamy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rkumaraswamy( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rkumaraswamy( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/iter/kumaraswamy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/kumaraswamy' );\n*\n* var iter = iterator( 2.0, 1.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlaplace = require( './../../../base/laplace' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlaplace( mu, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlaplace( mu, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/iter/laplace\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/laplace' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlevy = require( './../../../base/levy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, c, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlevy( mu, c, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlevy( mu, c );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, c, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/iter/levy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/levy' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlogis = require( './../../../base/logistic' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, s, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlogis( mu, s, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlogis( mu, s );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/iter/logistic\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/logistic' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlognorm = require( './../../../base/lognormal' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlognorm( mu, sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlognorm( mu, sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/iter/lognormal\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/lognormal' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar minstd = require( './../../../base/minstd' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = minstd( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = minstd();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/iter/minstd\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/minstd' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar minstd = require( './../../../base/minstd-shuffle' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = minstd( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = minstd();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/iter/minstd-shuffle\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/minstd-shuffle' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = mt19937( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = mt19937();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/iter/mt19937\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/mt19937' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnbinom = require( './../../../base/negative-binomial' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} second argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 8, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( r, p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( r ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', r ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnbinom( r, p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnbinom( r, p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( r, p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/iter/negative-binomial\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/negative-binomial' );\n*\n* var iter = iterator( 10, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/normal' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( mu, sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm( mu, sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/iter/normal\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/normal' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rpareto = require( './../../../base/pareto-type1' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rpareto( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rpareto( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/iter/pareto-type1\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/pareto-type1' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rpois = require( './../../../base/poisson' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rpois( lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rpois( lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/iter/poisson\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/poisson' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randi = require( './../../../base/randi' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randi( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randi();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/iter/randi\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randi' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randn = require( './../../../base/randn' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randn( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randn();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @module @stdlib/random/iter/randn\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randn' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randu = require( './../../../base/randu' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating uniformly distributed pseudorandom numbers between 0 and 1.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randu( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randu();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating uniformly distributed pseudorandom numbers between 0 and 1.\n*\n* @module @stdlib/random/iter/randu\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randu' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rrayleigh = require( './../../../base/rayleigh' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rrayleigh( sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rrayleigh( sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( sigma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/iter/rayleigh\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/rayleigh' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rt = require( './../../../base/t' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( v, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( v ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rt( v, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rt( v );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( v, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @module @stdlib/random/iter/t\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/t' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rtriangular = require( './../../../base/triangular' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, c, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\tthrow new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\tif ( arguments.length > 3 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rtriangular( a, b, c, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rtriangular( a, b, c );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, c, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/iter/triangular\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/triangular' );\n*\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar runif = require( './../../../base/uniform' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = runif( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = runif( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/iter/uniform\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/uniform' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rweibull = require( './../../../base/weibull' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rweibull( k, lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rweibull( k, lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/iter/weibull\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/weibull' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../iter/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../iter/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../iter/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../iter/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../iter/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/box-muller}\n*/\nsetReadOnly( ns, 'boxMuller', require( './../../iter/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../iter/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../iter/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../iter/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../iter/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../iter/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../iter/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../iter/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/f}\n*/\nsetReadOnly( ns, 'f', require( './../../iter/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../iter/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../iter/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../iter/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../iter/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../iter/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/improved-ziggurat}\n*/\nsetReadOnly( ns, 'improvedZiggurat', require( './../../iter/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../iter/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../iter/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../iter/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../iter/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../iter/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../iter/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../iter/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../iter/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../iter/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../iter/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../iter/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../iter/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../iter/poisson' ) );\n\n/**\n* @name randi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randi}\n*/\nsetReadOnly( ns, 'randi', require( './../../iter/randi' ) );\n\n/**\n* @name randn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randn}\n*/\nsetReadOnly( ns, 'randn', require( './../../iter/randn' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../iter/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../iter/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/t}\n*/\nsetReadOnly( ns, 't', require( './../../iter/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../iter/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../iter/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../iter/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Samples from a discrete uniform distribution (equal probabilities and with replacement).\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @returns {Array} sample\n*/\nfunction discreteUniform( x, size, rand ) {\n\tvar pos;\n\tvar out;\n\tvar N;\n\tvar i;\n\n\tN = x.length;\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tpos = floor( N * rand() );\n\t\tout[ i ] = x[ pos ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Samples without replacement from a discrete set using custom probabilities.\n*\n* ## Notes\n*\n* - After each draw, the probabilities of the remaining observations are renormalized so that they sum to one.\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @param {ProbabilityArray} probabilities - element probabilities\n* @returns {Array} sample\n*/\nfunction renormalizing( x, size, rand, probabilities ) {\n\tvar probs;\n\tvar psum;\n\tvar out;\n\tvar N;\n\tvar i;\n\tvar j;\n\tvar k;\n\tvar u;\n\n\tN = x.length;\n\tprobs = new Array( N );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tprobs[ i ] = probabilities[ i ];\n\t}\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tu = rand();\n\t\tpsum = 0;\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tpsum += probs[ j ];\n\t\t\tif ( u < psum ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor ( k = 0; k < N; k++ ) {\n\t\t\tif ( k === j ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprobs[ k ] /= 1.0 - probs[ j ];\n\t\t}\n\t\tprobs[ j ] = 0.0;\n\t\tout[ i ] = x[ j ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = renormalizing;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// FUNCTIONS //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Samples uniformly without replacement using the Fisher-Yates shuffle.\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @returns {Array} sample\n*/\nfunction fisherYates( x, size, rand ) {\n\tvar tmp;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tN = x.length;\n\n\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\tfor ( i = N-1; i > 0; i-- ) {\n\t\t// Generate an integer index on the interval: [0,i]\n\t\tj = floor( rand()*(i+1) );\n\n\t\t// Swap elements:\n\t\ttmp = x[ i ];\n\t\tx[ i ] = x[ j ];\n\t\tx[ j ] = tmp;\n\t}\n\treturn slice.call( x, 0, size );\n}\n\n\n// EXPORTS //\n\nmodule.exports = fisherYates;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Samples with replacement and non-uniform probabilities using Vose's [alias method][alias-method].\n*\n* ## References\n*\n* - Vose, Michael D. 1991. \"A linear algorithm for generating random numbers with a given distribution.\" _IEEE Transactions on Software Engineering_ 17 (9): 972\u201375. doi:[10.1109/32.92917][@vose:1991].\n*\n* [alias-method]: http://keithschwarz.com/darts-dice-coins/\n* [@vose:1991]: https://doi.org/10.1109/32.92917\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @param {ProbabilityArray} probabilities - element probabilities\n* @returns {Array} sample\n*/\nfunction vose( x, size, rand, probabilities ) {\n\tvar small;\n\tvar large;\n\tvar probs;\n\tvar alias;\n\tvar out;\n\tvar N;\n\tvar p;\n\tvar g;\n\tvar i;\n\tvar l;\n\n\tprobs = probabilities.slice();\n\tN = x.length;\n\n\tsmall = [];\n\tlarge = [];\n\tfor ( i = 0; i < N; i++ ) {\n\t\tprobs[ i ] *= N;\n\t\tif ( probs[ i ] < 1.0 ) {\n\t\t\tsmall.push( i );\n\t\t} else {\n\t\t\tlarge.push( i );\n\t\t}\n\t}\n\talias = new Array( N );\n\tp = new Array( N );\n\twhile ( small.length !== 0 && large.length !== 0 ) {\n\t\tl = small.shift();\n\t\tg = large.shift();\n\t\tp[ l ] = probs[ l ];\n\t\talias[ l ] = g;\n\t\tprobs[ g ] = probs[ g ] + probs[ l ] - 1.0;\n\t\tif ( probs[ g ] < 1.0 ) {\n\t\t\tsmall.push( g );\n\t\t} else {\n\t\t\tlarge.push( g );\n\t\t}\n\t}\n\tfor ( i = 0; i < large.length; i++ ) {\n\t\tp[ large[ i ] ] = 1.0;\n\t}\n\tfor ( i = 0; i < small.length; i++ ) {\n\t\tp[ small[ i ] ] = 1.0;\n\t}\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tl = floor( N*rand() );\n\t\tif ( rand() < p[ l ] ) {\n\t\t\tout[ i ] = x[ l ];\n\t\t} else {\n\t\t\tout[ i ] = x[ alias[ l ] ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = vose;\n", "{\n\t\"mutate\": false,\n\t\"replace\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );\nvar isUnityProbabilityArray = require( '@stdlib/assert/is-unity-probability-array' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {ProbabilityArray} [options.probs] - element probabilities\n* @param {boolean} [options.replace] - boolean indicating whether to sample with replacement\n* @param {boolean} [options.mutate] - boolean indicating whether to mutate the `pool` when sampling without replacement\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'size': 10,\n* 'replace': false,\n* 'mutate': true,\n* 'probs': [ 0.7, 0.3 ]\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'size' ) ) {\n\t\topts.size = options.size;\n\t\tif ( !isNonNegativeInteger( opts.size ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'size', opts.size ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'probs' ) ) {\n\t\topts.probs = options.probs;\n\t\tif ( !isUnityProbabilityArray( opts.probs ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be an array of probabilities that sum to one. Option: `%s`.', 'probs', opts.probs ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'mutate' ) ) {\n\t\topts.mutate = options.mutate;\n\t\tif ( !isBoolean( opts.mutate ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'mutate', opts.mutate ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'replace' ) ) {\n\t\topts.replace = options.replace;\n\t\tif ( !isBoolean( opts.replace ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'replace', opts.replace ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert/is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar randu = require( './../../base/mt19937' ).factory;\nvar copy = require( '@stdlib/utils/copy' );\nvar discreteUniform = require( './discrete_uniform.js' );\nvar renormalizing = require( './renormalizing.js' );\nvar fisherYates = require( './fisher_yates.js' );\nvar vose = require( './vose.js' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// FUNCTIONS //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns a function to sample elements from an array-like object.\n*\n* @param {(ArrayLike|TypedArrayLike)} [pool] - array-like object from which to sample\n* @param {Options} [options] - function options\n* @param {PositiveInteger} [options.seed] - integer-valued seed\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement\n* @throws {TypeError} `pool` must be an array-like object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} function to sample elements from an array-like object\n*\n* @example\n* var sample = factory({\n* 'seed': 232\n* });\n* var out = sample( 'abcdefg' );\n* // e.g., returns [ 'g', 'd', 'g', 'f', 'c', 'e', 'f' ]\n*\n* @example\n* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {\n* 'seed': 232,\n* 'size': 2\n* });\n* var out = sample();\n* // e.g., returns [ 6, 4 ]\n*\n* out = sample();\n* // e.g., returns [ 6, 5 ]\n*\n* @example\n* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {\n* 'seed': 474,\n* 'size': 3,\n* 'mutate': true,\n* 'replace': false\n* });\n* var out = sample();\n* // e.g., returns [ 4, 3, 6 ]\n*\n* out = sample();\n* // e.g., returns [ 1, 5, 2 ]\n*\n* out = sample();\n* // returns null\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'size': 10\n* });\n* // e.g., returns [ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1 ]\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'replace': false\n* });\n* // e.g., returns [ 0, 1 ] or [ 1, 0 ]\n*\n* out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2,\n* 'mutate': true\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'replace': false\n* });\n* // e.g., returns [ 0, 1 ] or [ 1, 0 ]\n*\n* out = sample();\n* // returns null\n*/\nfunction factory() {\n\tvar config;\n\tvar pool;\n\tvar conf;\n\tvar rand;\n\tvar err;\n\tvar fcn;\n\n\tconf = copy( defaults );\n\tif ( arguments.length === 1 ) {\n\t\tif ( isArrayLike( arguments[ 0 ] ) || isTypedArrayLike( arguments[ 0 ] ) ) { // eslint-disable-line max-len\n\t\t\tpool = arguments[ 0 ];\n\t\t} else {\n\t\t\tconfig = arguments[ 0 ];\n\t\t\terr = validate( conf, config );\n\t\t}\n\t} else if ( arguments.length > 1 ) {\n\t\tpool = arguments[ 0 ];\n\t\tconfig = arguments[ 1 ];\n\t\tif ( !( isArrayLike( pool ) || isTypedArrayLike( pool ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. `%s` argument must be array-like. Value: `%s`.', 'pool', pool ) );\n\t\t}\n\t\terr = validate( conf, config );\n\t}\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( config && config.seed ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tif ( pool === void 0 ) {\n\t\tfcn = sample1;\n\t} else {\n\t\tif ( isString( pool ) ) {\n\t\t\tpool = pool.split( '' );\n\t\t} else {\n\t\t\tpool = copy( pool );\n\t\t}\n\t\tfcn = sample2;\n\t}\n\tsetReadOnly( fcn, 'seed', rand.seed );\n\tsetReadOnly( fcn, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn fcn;\n\n\t/**\n\t* Samples elements from an array-like object.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} x - array-like object from which to sample elements\n\t* @param {Options} [options] - function options\n\t* @param {NonNegativeInteger} [options.size] - sample size\n\t* @param {ProbabilityArray} [options.probs] - element probabilities\n\t* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`\n\t* @returns {Array} sample\n\t*/\n\tfunction sample1( x, options ) {\n\t\tvar replace;\n\t\tvar xcopy;\n\t\tvar probs;\n\t\tvar opts;\n\t\tvar size;\n\t\tvar err;\n\n\t\tif ( !( isArrayLike( x ) || isTypedArrayLike( x ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', x ) );\n\t\t}\n\t\tif ( isString( x ) ) {\n\t\t\tx = x.split( '' );\n\t\t}\n\t\topts = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tif ( opts.replace === void 0 ) {\n\t\t\treplace = conf.replace;\n\t\t} else {\n\t\t\treplace = opts.replace;\n\t\t}\n\t\tif ( opts.probs !== void 0 ) {\n\t\t\tprobs = opts.probs;\n\t\t}\n\t\tif ( opts.size ) {\n\t\t\tsize = opts.size;\n\t\t} else if ( conf.size ) {\n\t\t\tsize = conf.size;\n\t\t} else {\n\t\t\tsize = x.length;\n\t\t}\n\t\tif (\n\t\t\treplace === false &&\n\t\t\tsize > x.length\n\t\t) {\n\t\t\tthrow new RangeError( format( 'invalid option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `%s`.', size ) );\n\t\t}\n\t\t// Custom probabilities...\n\t\tif ( probs ) {\n\t\t\tif ( replace ) {\n\t\t\t\treturn vose( x, size, rand, probs );\n\t\t\t}\n\t\t\treturn renormalizing( x, size, rand, probs );\n\t\t}\n\t\t// All elements equally likely...\n\t\tif ( replace ) {\n\t\t\treturn discreteUniform( x, size, rand );\n\t\t}\n\t\txcopy = slice.call( x );\n\t\treturn fisherYates( xcopy, size, rand );\n\t}\n\n\t/**\n\t* Samples elements from a population.\n\t*\n\t* @private\n\t* @param {Options} [options] - function options\n\t* @param {NonNegativeInteger} [options.size] - sample size\n\t* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n\t* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {RangeError} `size` option must be less than or equal to the population when the `replace` option is `false`\n\t* @returns {Array} sample\n\t*/\n\tfunction sample2( options ) {\n\t\tvar replace;\n\t\tvar mutate;\n\t\tvar opts;\n\t\tvar size;\n\t\tvar err;\n\t\tvar out;\n\n\t\tif ( pool.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\t\topts = {};\n\t\tif ( arguments.length ) {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tif ( opts.mutate === void 0 ) {\n\t\t\tmutate = conf.mutate;\n\t\t} else {\n\t\t\tmutate = opts.mutate;\n\t\t}\n\t\tif ( opts.replace === void 0 ) {\n\t\t\treplace = conf.replace;\n\t\t} else {\n\t\t\treplace = opts.replace;\n\t\t}\n\t\tif ( opts.size ) {\n\t\t\tsize = opts.size;\n\t\t} else if ( conf.size ) {\n\t\t\tsize = conf.size;\n\t\t} else {\n\t\t\tsize = pool.length;\n\t\t}\n\t\tif (\n\t\t\treplace === false &&\n\t\t\tsize > pool.length\n\t\t) {\n\t\t\tthrow new RangeError( format( 'invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.', size ) );\n\t\t}\n\t\tif ( replace ) {\n\t\t\treturn discreteUniform( pool, size, rand );\n\t\t}\n\t\tout = fisherYates( pool, size, rand );\n\t\tif ( mutate ) {\n\t\t\t// Remove the sample observations:\n\t\t\tpool = pool.slice( size, pool.length );\n\t\t}\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Samples elements from an array-like object.\n*\n* @name sample\n* @type {Function}\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {Options} [options] - function options\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {ProbabilityArray} [options.probs] - element probabilities\n* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n* @throws {TypeError} first argument must be array-like\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`\n* @returns {Array} sample\n*\n* @example\n* var out = sample( [ 3, null, NaN, 'abc', function(){} ] );\n* // e.g., returns [ 3, 'abc', null, 3, null ]\n*/\nvar sample = factory();\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sample elements from an array-like object.\n*\n* @module @stdlib/random/sample\n*\n* @example\n* var sample = require( '@stdlib/random/sample' );\n*\n* var out = sample( 'abc' );\n* // e.g., returns [ 'a', 'a', 'b' ]\n*\n* out = sample( [ 3, 6, 9 ] );\n* // e.g., returns [ 3, 9, 6 ]\n*\n* var bool = ( out.length === 3 );\n* // returns true\n*\n* @example\n* var sample = require( '@stdlib/random/sample' );\n*\n* var mysample = sample.factory({\n* 'seed': 323\n* });\n* var out = mysample( [ 3, 6, 9 ], {\n* 'size': 10\n* });\n* // e.g., returns [ 3, 9, 3, 3, 3, 6, 3, 3, 3, 6 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"copy\": \"shallow\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar indexOf = require( '@stdlib/utils/index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar COPY_OPTIONS = [ 'deep', 'shallow', 'none' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {string} [options.copy] - string denoting whether to return a copy (`deep`, `shallow` or `none`)\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'copy': 'shallow'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isString( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( indexOf( COPY_OPTIONS, opts.copy ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'copy', COPY_OPTIONS.join( '\", \"' ), opts.copy ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert/is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar deepCopy = require( '@stdlib/utils/copy' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar randu = require( './../../base/mt19937' ).factory;\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to create a random permutation of elements from an array-like object.\n*\n* @param {Options} [config] - function options\n* @param {PositiveInteger} [config.seed] - integer-valued seed\n* @param {string} [config.copy=\"shallow\"] - default copy option (`deep`, `shallow` or `none`)\n* @throws {TypeError} options argument must be an object\n* @returns {Function} shuffle function\n*\n* @example\n* var shuffle = factory({\n* 'seed': 249\n* });\n* var data = [ 3, 8, 4, 8 ];\n* var out = shuffle( data );\n* // e.g., returns [ 4, 3, 8, 8 ]\n*/\nfunction factory( config ) {\n\tvar conf;\n\tvar rand;\n\tvar err;\n\n\tconf = deepCopy( defaults );\n\tif ( arguments.length ) {\n\t\terr = validate( conf, config );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( config && config.seed ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tsetReadOnly( shuffle, 'seed', rand.seed );\n\tsetReadOnly( shuffle, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn shuffle;\n\n\t/**\n\t* Returns a random permutation of elements in `arr`.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} arr - array-like object to shuffle\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.copy] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {ArrayLike} the shuffled array-like object\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data );\n\t* // e.g., returns [ 3, 1, 2 ]\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data, {\n\t* 'copy': 'none'\n\t* });\n\t* var bool = ( data === out );\n\t* // returns true\n\t*/\n\tfunction shuffle( arr, options ) {\n\t\tvar strflg;\n\t\tvar level;\n\t\tvar copy;\n\t\tvar opts;\n\t\tvar err;\n\t\tvar out;\n\t\tvar tmp;\n\t\tvar N;\n\t\tvar i;\n\t\tvar j;\n\n\t\tif ( !( isArrayLike( arr ) || isTypedArrayLike( arr ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', arr ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = {};\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tcopy = ( opts && opts.copy ) ? opts.copy : conf.copy;\n\n\t\tstrflg = isString( arr );\n\t\tif ( strflg ) {\n\t\t\tarr = arr.split( '' );\n\t\t\tcopy = 'none';\n\t\t}\n\n\t\tlevel = 0;\n\t\tif ( copy === 'shallow' ) {\n\t\t\tlevel += 1;\n\t\t} else if ( copy === 'deep' ) {\n\t\t\tlevel += 2;\n\t\t}\n\t\tN = arr.length;\n\t\tout = deepCopy( arr, level );\n\n\t\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\t\tfor ( i = N - 1; i > 0; i-- ) {\n\t\t\t// Generate an integer index on the interval [0,i]:\n\t\t\tj = floor( rand() * (i+1.0) );\n\n\t\t\t// Swap elements:\n\t\t\ttmp = out[ i ];\n\t\t\tout[ i ] = out[ j ];\n\t\t\tout[ j ] = tmp;\n\t\t}\n\n\t\tif ( strflg ) {\n\t\t\tout = arr.join( '' );\n\t\t}\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random permutation of elements in `arr`.\n*\n* @name shuffle\n* @type {Function}\n* @param {ArrayLike} arr - array-like object to shuffle\n* @param {Options} [options] - function options\n* @param {string} [options.copy=\"shallow\"] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n* @throws {TypeError} options must be an object\n* @throws {TypeError} must provide valid options\n* @returns {ArrayLike} the shuffled array-like object\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data, {\n* 'copy': 'none'\n* });\n* var bool = ( data === out );\n* // returns true\n*/\nvar shuffle = factory();\n\n\n// EXPORTS //\n\nmodule.exports = shuffle;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a random permutation of elements from an array-like object.\n*\n* @module @stdlib/random/shuffle\n*\n* @example\n* var shuffle = require( '@stdlib/random/shuffle' );\n*\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* out = shuffle( data, {\n* 'copy': 'none'\n* });\n*\n* var bool = ( data === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:arcsine' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rarcsine = require( './../../../base/arcsine' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an arcsine distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rarcsine( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/streams/arcsine\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:bernoulli' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbern = require( './../../../base/bernoulli' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @constructor\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 0.5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( p, options );\n\t\t}\n\t\treturn new RandomStream( p );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbern( p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 0.7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( p, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.3 ) );\n* }\n*/\nfunction factory( p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isProbability( p ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( p ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', p ) );\n\t\t\t}\n\t\t\topts = assign( {}, p );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( p ) {\n\t\treturn new RandomStream( p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/streams/bernoulli\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:beta' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbeta = require( './../../../base/beta' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a beta distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbeta( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/streams/beta\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:betaprime' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbetaprime = require( './../../../base/betaprime' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a beta prime distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbetaprime( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/streams/betaprime\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:binomial' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbinom = require( './../../../base/binomial' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a binomial distribution.\n*\n* @constructor\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20, 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( n, p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( n, p, options );\n\t\t}\n\t\treturn new RandomStream( n, p );\n\t}\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbinom( n, p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20, 0.1, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( n, p, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( n, p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20, 0.5 ) );\n* }\n*/\nfunction factory( n, p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( n ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', n ) );\n\t\t}\n\t\topts = assign( {}, n );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} n - number of trials\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `n` must be a positive integer\n\t* @throws {TypeError} `p` must be a positive probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( n, p ) {\n\t\treturn new RandomStream( n, p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `n` must be a positive integer\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( n, p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/streams/binomial\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 20, 0.4, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20, 0.4 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 20, 0.4, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:box-muller' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/box-muller' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @module @stdlib/random/streams/box-muller\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:cauchy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rcauchy = require( './../../../base/cauchy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @constructor\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( x0, gamma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( x0, gamma, options );\n\t\t}\n\t\treturn new RandomStream( x0, gamma );\n\t}\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositiveNumber( gamma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rcauchy( x0, gamma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( x0, gamma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( x0, gamma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( x0, gamma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( x0 ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', x0 ) );\n\t\t}\n\t\topts = assign( {}, x0 );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @param {number} x0 - location parameter\n\t* @param {PositiveNumber} gamma - scale parameter\n\t* @throws {TypeError} `gamma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( x0, gamma ) {\n\t\treturn new RandomStream( x0, gamma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `gamma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( x0, gamma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/streams/cauchy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:chi' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rchi = require( './../../../base/chi' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a chi distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( k, options );\n\t\t}\n\t\treturn new RandomStream( k );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rchi( k, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( k, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( k ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( k ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t\t}\n\t\t\topts = assign( {}, k );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k ) {\n\t\treturn new RandomStream( k, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/streams/chi\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:chisquare' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rchisquare = require( './../../../base/chisquare' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a chi-square distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( k, options );\n\t\t}\n\t\treturn new RandomStream( k );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rchisquare( k, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, opts );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( k, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options);\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( k ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( k ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t\t}\n\t\t\topts = assign( {}, k );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k ) {\n\t\treturn new RandomStream( k, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/streams/chisquare\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:cosine' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rcosine = require( './../../../base/cosine' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @constructor\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, s, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, s, options );\n\t\t}\n\t\treturn new RandomStream( mu, s );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rcosine( mu, s, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, s, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, s, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, s, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, s ) {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/streams/cosine\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:discrete-uniform' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rduniform = require( './../../../base/discrete-uniform' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @constructor\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2, 5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isInteger( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rduniform( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2, 5, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n\t*\n\t* @private\n\t* @param {integer} a - minimum support\n\t* @param {integer} b - maximum support\n\t* @throws {TypeError} `a` must be an integer\n\t* @throws {TypeError} `b` must be an integer\n\t* @throws {RangeError} `a` must be less than or equal to `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be an integer\n\t* @throws {TypeError} `b` must be an integer\n\t* @throws {RangeError} `a` must be less than or equal to `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/streams/discrete-uniform\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2, 5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2, 5, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:erlang' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rerlang = require( './../../../base/erlang' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an Erlang distribution.\n*\n* @constructor\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( k, lambda, options );\n\t\t}\n\t\treturn new RandomStream( k, lambda );\n\t}\n\tif ( !isPositiveInteger( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rerlang( k, lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5.0 ) );\n* }\n*/\nfunction factory( k, lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t}\n\t\topts = assign( {}, k );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} k - shape parameter\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @throws {TypeError} `k` must be a positive integer\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k, lambda ) {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive integer\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/streams/erlang\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:exponential' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rexponential = require( './../../../base/exponential' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an exponential distribution.\n*\n* @constructor\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( lambda, options );\n\t\t}\n\t\treturn new RandomStream( lambda );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rexponential( lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( lambda ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( lambda ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', lambda ) );\n\t\t\t}\n\t\t\topts = assign( {}, lambda );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( lambda ) {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/streams/exponential\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:f' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rf = require( './../../../base/f' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an F distribution.\n*\n* @constructor\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( d1, d2, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( d1, d2, options );\n\t\t}\n\t\treturn new RandomStream( d1, d2 );\n\t}\n\tif ( !isPositiveNumber( d1 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositiveNumber( d2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rf( d1, d2, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( d1, d2, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( d1, d2, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( d1, d2, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( d1 ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', d1 ) );\n\t\t}\n\t\topts = assign( {}, d1 );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an F distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} d1 - degrees of freedom\n\t* @param {PositiveNumber} d2 - degrees of freedom\n\t* @throws {TypeError} `d1` must be a positive number\n\t* @throws {TypeError} `d2` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( d1, d2 ) {\n\t\treturn new RandomStream( d1, d2, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an F distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `d1` must be a positive number\n\t* @throws {TypeError} `d2` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( d1, d2, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/streams/f\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:frechet' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rfrechet = require( './../../../base/frechet' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @constructor\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, 1.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, s, m, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( alpha, s, m, options );\n\t\t}\n\t\treturn new RandomStream( alpha, s, m );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number and not NaN. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number. Value: `%s`.', m ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rfrechet( alpha, s, m, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, -1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, s, m, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, s, m, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 0.0 ) );\n* }\n*/\nfunction factory( alpha, s, m, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {number} m - location parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} `m` must be a number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, s, m ) {\n\t\treturn new RandomStream( alpha, s, m, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} `m` must be a number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, s, m, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/streams/frechet\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, 3.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, -2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, 0.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:gamma' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgamma = require( './../../../base/gamma' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a gamma distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgamma( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/streams/gamma\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:geometric' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgeom = require( './../../../base/geometric' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a geometric distribution.\n*\n* @constructor\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 0.5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( p, options );\n\t\t}\n\t\treturn new RandomStream( p );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgeom( p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 0.7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( p, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.3 ) );\n* }\n*/\nfunction factory( p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isProbability( p ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( p ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', p ) );\n\t\t\t}\n\t\t\topts = assign( {}, p );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( p ) {\n\t\treturn new RandomStream( p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/streams/geometric\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:gumbel' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgumbel = require( './../../../base/gumbel' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, beta, options );\n\t\t}\n\t\treturn new RandomStream( mu, beta );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgumbel( mu, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, beta ) {\n\t\treturn new RandomStream( mu, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/streams/gumbel\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:hypergeometric' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rhypergeom = require( './../../../base/hypergeometric' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @constructor\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {RangeError} `K` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20, 10, 7, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( N, K, n, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( N, K, n, options );\n\t\t}\n\t\treturn new RandomStream( N, K, n );\n\t}\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\tthrow new RangeError( 'invalid argument. Third argument must be less than or equal to the first argument.' );\n\t}\n\tif ( K > N ) {\n\t\tthrow new RangeError( 'invalid argument. Second argument must be less than or equal to the first argument.' );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rhypergeom( N, K, n, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {RangeError} `K` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20, 10, 7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( N, K, n, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( N, K, n, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 5, 3, 2 ) );\n* }\n*/\nfunction factory( N, K, n, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( N ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', N ) );\n\t\t}\n\t\topts = assign( {}, N );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} N - population size\n\t* @param {NonNegativeInteger} K - subpopulation size\n\t* @param {NonNegativeInteger} n - number of draws\n\t* @throws {TypeError} `N` must be a nonnegative integer\n\t* @throws {TypeError} `K` must be a nonnegative integer\n\t* @throws {TypeError} `n` must be a nonnegative integer\n\t* @throws {RangeError} `n` must be less than or equal to `N`\n\t* @throws {RangeError} `K` must be less than or equal to `N`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( N, K, n ) {\n\t\treturn new RandomStream( N, K, n, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `N` must be a nonnegative integer\n\t* @throws {TypeError} `K` must be a nonnegative integer\n\t* @throws {TypeError} `n` must be a nonnegative integer\n\t* @throws {RangeError} `n` must be less than or equal to `N`\n\t* @throws {RangeError} `K` must be less than or equal to `N`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( N, K, n, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/streams/hypergeometric\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 5, 3, 2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 5, 3, 2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 5, 3, 2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:improved-ziggurat' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @module @stdlib/random/streams/improved-ziggurat\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:invgamma' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rinvgamma = require( './../../../base/invgamma' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rinvgamma( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/streams/invgamma\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:kumaraswamy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rkumaraswamy = require( './../../../base/kumaraswamy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @constructor\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isPositiveNumber( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rkumaraswamy( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} a - first shape parameter\n\t* @param {PositiveNumber} b - second shape parameter\n\t* @throws {TypeError} `a` must be a positive number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a positive number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/streams/kumaraswamy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:laplace' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlaplace = require( './../../../base/laplace' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, b, options );\n\t\t}\n\t\treturn new RandomStream( mu, b );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlaplace( mu, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} b - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, b ) {\n\t\treturn new RandomStream( mu, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/streams/laplace\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:levy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlevy = require( './../../../base/levy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, c, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, c, options );\n\t\t}\n\t\treturn new RandomStream( mu, c );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlevy( mu, c, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, c, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, c, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, c, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} c - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `c` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, c ) {\n\t\treturn new RandomStream( mu, c, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `c` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, c, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/streams/levy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:logistic' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlogistic = require( './../../../base/logistic' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a logistic distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, s, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, s, options );\n\t\t}\n\t\treturn new RandomStream( mu, s );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlogistic( mu, s, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, s, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, s, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, s, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, s ) {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/streams/logistic\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:lognormal' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlognormal = require( './../../../base/lognormal' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a lognormal distribution.\n*\n* @constructor\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, sigma, options );\n\t\t}\n\t\treturn new RandomStream( mu, sigma );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlognormal( mu, sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, sigma ) {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/streams/lognormal\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.0, 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:minstd' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar minstd = require( './../../../base/minstd' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMINSTD} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMINSTD} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMINSTD} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = minstd( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMINSTD}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMINSTD}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/streams/minstd\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:minstd-shuffle' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar minstd = require( './../../../base/minstd-shuffle' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMINSTD} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMINSTD} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMINSTD} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = minstd( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMINSTD}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMINSTD}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/streams/minstd-shuffle\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:mt19937' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMT19937} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMT19937} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = mt19937( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMT19937}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMT19937}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/streams/mt19937\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:negative-binomial' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rnbinom = require( './../../../base/negative-binomial' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a binomial distribution.\n*\n* @constructor\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20.0, 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( r, p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( r, p, options );\n\t\t}\n\t\treturn new RandomStream( r, p );\n\t}\n\tif ( !isPositiveNumber( r ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', r ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rnbinom( r, p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20.0, 0.1, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( r, p, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( r, p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {Probability} [p] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20.0, 0.5 ) );\n* }\n*/\nfunction factory( r, p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( r ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', r ) );\n\t\t}\n\t\topts = assign( {}, r );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} r - number of trials\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `r` must be a positive number\n\t* @throws {TypeError} `p` must be a positive probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( r, p ) {\n\t\treturn new RandomStream( r, p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `r` must be a positive number\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( r, p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/streams/negative-binomial\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 20.0, 0.4, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20.0, 0.4 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 20.0, 0.4, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:normal' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rnorm = require( './../../../base/normal' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a normal distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, sigma, options );\n\t\t}\n\t\treturn new RandomStream( mu, sigma );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rnorm( mu, sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, sigma ) {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/streams/normal\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.0, 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:pareto1' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rpareto1 = require( './../../../base/pareto-type1' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rpareto1( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/streams/pareto-type1\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:poisson' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rpoisson = require( './../../../base/poisson' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Poisson distribution.\n*\n* @constructor\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( lambda, options );\n\t\t}\n\t\treturn new RandomStream( lambda );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rpoisson( lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} [lambda] - mean\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( lambda ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( lambda ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', lambda ) );\n\t\t\t}\n\t\t\topts = assign( {}, lambda );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - mean\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( lambda ) {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/streams/poisson\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"mt19937\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randi' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randi = require( './../../../base/randi' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {*} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {*} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {*} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers having integer values.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randi( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {*}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {*}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers having integer values.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/streams/randi\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"improved-ziggurat\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randn' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/randn' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers from a standard normal distribution.\n*\n* @module @stdlib/random/streams/randn\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"mt19937\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randu' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randu = require( './../../../base/randu' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {*} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {*} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {*} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randu( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {*}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {*}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {Function} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/streams/randu\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:rayleigh' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rrayleigh = require( './../../../base/rayleigh' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @constructor\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( sigma, options );\n\t\t}\n\t\treturn new RandomStream( sigma );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rrayleigh( sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( sigma ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( sigma ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', sigma ) );\n\t\t\t}\n\t\t\topts = assign( {}, sigma );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( sigma ) {\n\t\treturn new RandomStream( sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( sigma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/streams/rayleigh\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:t' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rt = require( './../../../base/t' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Student's t distribution.\n*\n* @constructor\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( v, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( v, options );\n\t\t}\n\t\treturn new RandomStream( v );\n\t}\n\tif ( !isPositiveNumber( v ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rt( v, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( v, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( v, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( v, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( v ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( v ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', v ) );\n\t\t\t}\n\t\t\topts = assign( {}, v );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} v - degrees of freedom\n\t* @throws {TypeError} `v` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( v ) {\n\t\treturn new RandomStream( v, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `v` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( v, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @module @stdlib/random/streams/t\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:triangular' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rtriang = require( './../../../base/triangular' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a uniform distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, c, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( a, b, c, options );\n\t\t}\n\t\treturn new RandomStream( a, b, c );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\tthrow new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rtriang( a, b, c, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, c, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, c, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 4.0 ) );\n* }\n*/\nfunction factory( a, b, c, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {number} c - mode\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {TypeError} `c` must be a number\n\t* @throws {RangeError} arguments must satisfy `a <= c <= b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b, c ) {\n\t\treturn new RandomStream( a, b, c, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {TypeError} `c` must be a number\n\t* @throws {RangeError} arguments must satisfy `a <= c <= b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, c, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/streams/triangular\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:uniform' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar runiform = require( './../../../base/uniform' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a uniform distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', runiform( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a uniform distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n*\n* @module @stdlib/random/streams/uniform\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:weibull' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rweibull = require( './../../../base/weibull' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Weibull distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( k, lambda, options );\n\t\t}\n\t\treturn new RandomStream( k, lambda );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rweibull( k, lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( k, lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t}\n\t\topts = assign( {}, k );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - scale parameter\n\t* @param {PositiveNumber} lambda - shape parameter\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k, lambda ) {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/streams/weibull\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../streams/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../streams/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../streams/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../streams/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../streams/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/box-muller}\n*/\nsetReadOnly( ns, 'boxMuller', require( './../../streams/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../streams/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../streams/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../streams/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../streams/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../streams/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../streams/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../streams/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/f}\n*/\nsetReadOnly( ns, 'f', require( './../../streams/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../streams/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../streams/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../streams/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../streams/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../streams/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/improved-ziggurat}\n*/\nsetReadOnly( ns, 'improvedZiggurat', require( './../../streams/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../streams/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../streams/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../streams/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../streams/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../streams/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../streams/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../streams/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../streams/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../streams/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../streams/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../streams/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../streams/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../streams/poisson' ) );\n\n/**\n* @name randi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randi}\n*/\nsetReadOnly( ns, 'randi', require( './../../streams/randi' ) );\n\n/**\n* @name randn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randn}\n*/\nsetReadOnly( ns, 'randn', require( './../../streams/randn' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../streams/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../streams/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/t}\n*/\nsetReadOnly( ns, 't', require( './../../streams/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../streams/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../streams/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../streams/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/arcsine' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction arcsine( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction arcsine( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/strided/arcsine\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var arcsine = require( '@stdlib/random/strided/arcsine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var arcsine = require( '@stdlib/random/strided/arcsine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/beta' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction beta( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction beta( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/strided/beta\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var beta = require( '@stdlib/random/strided/beta' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var beta = require( '@stdlib/random/strided/beta' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/betaprime' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction betaprime( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction betaprime( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/strided/betaprime\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var betaprime = require( '@stdlib/random/strided/betaprime' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var betaprime = require( '@stdlib/random/strided/betaprime' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/cosine' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {Collection} s - scale parameter\n* @param {integer} ss - `s` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction cosine( N, mu, sm, s, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, s, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, s, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} s - scale parameter\n* @param {integer} ss - `s` stride length\n* @param {NonNegativeInteger} os - starting `s` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction cosine( N, mu, sm, om, s, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, s, ss, os, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, s, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/strided/cosine\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var cosine = require( '@stdlib/random/strided/cosine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var cosine = require( '@stdlib/random/strided/cosine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/discrete-uniform' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than or equal to maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1 );\n*/\nfunction discreteUniform( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than or equal to maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 1, 0 );\n*/\nfunction discreteUniform( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/strided/discrete-uniform\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform.ndarray( out.length, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/exponential' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 1;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar unary = require( '@stdlib/strided/base/unary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} lambda - rate parameter\n* @param {integer} sl - `lambda` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, out, 1 );\n*/\nfunction exponential( N, lambda, sl, out, so, options ) {\n\tvar rand = prng( lambda, sl, 0, arguments.length > 5, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tunary( [ lambda, out ], [ N ], [ sl, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar unary = require( '@stdlib/strided/base/unary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} lambda - scale parameter\n* @param {integer} sl - `lambda` stride length\n* @param {NonNegativeInteger} ol - starting `lambda` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\nfunction exponential( N, lambda, sl, ol, out, so, oo, options ) {\n\tvar rand = prng( lambda, sl, ol, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tunary( [ lambda, out ], [ N ], [ sl, so ], [ ol, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/strided/exponential\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/strided/exponential' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/strided/exponential' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/gamma' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - rate parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction gamma( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - rate parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction gamma( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/strided/gamma\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var gamma = require( '@stdlib/random/strided/gamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var gamma = require( '@stdlib/random/strided/gamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/invgamma' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - scale parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction invgamma( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - scale parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction invgamma( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/strided/invgamma\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var invgamma = require( '@stdlib/random/strided/invgamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var invgamma = require( '@stdlib/random/strided/invgamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/lognormal' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - location parameter\n* @param {integer} sm - `mu` stride length\n* @param {Collection} sigma - scale parameter\n* @param {integer} ss - `sigma` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction lognormal( N, mu, sm, sigma, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, sigma, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - location parameter\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} sigma - scale parameter\n* @param {integer} ss - `sigma` stride length\n* @param {NonNegativeInteger} os - starting `sigma` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction lognormal( N, mu, sm, om, sigma, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, sigma, ss, os, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/strided/lognormal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var lognormal = require( '@stdlib/random/strided/lognormal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var lognormal = require( '@stdlib/random/strided/lognormal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @module @stdlib/random/strided/minstd\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/strided/minstd-shuffle\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*/\nfunction mt19937( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1, 0 );\n*/\nfunction mt19937( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*/\nfunction mt19937( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1, 0 );\n*/\nfunction mt19937( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/strided/mt19937\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/normal' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {Collection} sigma - standard deviation\n* @param {integer} ss - `sigma` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction normal( N, mu, sm, sigma, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, sigma, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} sigma - standard deviation\n* @param {integer} ss - `sigma` stride length\n* @param {NonNegativeInteger} os - starting `sigma` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction normal( N, mu, sm, om, sigma, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, sigma, ss, os, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/strided/normal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var normal = require( '@stdlib/random/strided/normal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var normal = require( '@stdlib/random/strided/normal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/randu' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1 );\n*/\nfunction randu( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/randu' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1, 0 );\n*/\nfunction randu( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/strided/randu\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var randu = require( '@stdlib/random/strided/randu' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var randu = require( '@stdlib/random/strided/randu' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu.ndarray( out.length, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/uniform' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction uniform( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction uniform( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/strided/uniform\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var uniform = require( '@stdlib/random/strided/uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var uniform = require( '@stdlib/random/strided/uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/weibull' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - scale parameter\n* @param {integer} sk - `k` stride length\n* @param {Collection} lambda - shape parameter\n* @param {integer} sl - `lambda` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction weibull( N, k, sk, lambda, sl, out, so, options ) {\n\tvar rand = prng( k, sk, 0, lambda, sl, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ k, lambda, out ], [ N ], [ sk, sl, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - scale parameter\n* @param {integer} sk - `k` stride length\n* @param {NonNegativeInteger} ok - starting `k` index\n* @param {Collection} lambda - shape parameter\n* @param {integer} sl - `lambda` stride length\n* @param {NonNegativeInteger} ol - starting `lambda` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction weibull( N, k, sk, ok, lambda, sl, ol, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( k, sk, ok, lambda, sl, ol, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ k, lambda, out ], [ N ], [ sk, sl, so ], [ ok, ol, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/strided/weibull\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var weibull = require( '@stdlib/random/strided/weibull' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var weibull = require( '@stdlib/random/strided/weibull' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../strided/arcsine' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../strided/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../strided/betaprime' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../strided/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../strided/discrete-uniform' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../strided/exponential' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../strided/gamma' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../strided/invgamma' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../strided/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../strided/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../strided/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../strided/mt19937' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../strided/normal' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../strided/randu' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../strided/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../strided/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name array\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/array}\n*/\nsetReadOnly( ns, 'array', require( './../array' ) );\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/base}\n*/\nsetReadOnly( ns, 'base', require( './../base' ) );\n\n/**\n* @name iterators\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/iter}\n*/\nsetReadOnly( ns, 'iterators', require( './../iter' ) );\n\n/**\n* @name sample\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/sample}\n*/\nsetReadOnly( ns, 'sample', require( './../sample' ) );\n\n/**\n* @name shuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/shuffle}\n*/\nsetReadOnly( ns, 'shuffle', require( './../shuffle' ) );\n\n/**\n* @name streams\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/streams}\n*/\nsetReadOnly( ns, 'streams', require( './../streams' ) );\n\n/**\n* @name strided\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/strided}\n*/\nsetReadOnly( ns, 'strided', require( './../strided' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"], + "mappings": "uGAAA,IAAAA,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cAsBA,IAAIC,GAAa,QAAS,8BAA+B,EACrDC,GAAQ,QAAS,iCAAkC,EAKnDC,GAAMF,GAAa,EAevB,SAASG,IAAa,CACrB,IAAIC,EAAIH,GAAO,EAAOC,GAAI,KAAK,OAAO,CAAG,EACzC,OAAOE,IAAM,CACd,CAKAL,GAAO,QAAUI,KCnDjB,IAAAE,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cA+DA,IAAIC,GAAc,QAAS,uDAAwD,EAC/EC,GAAsB,QAAS,uDAAwD,EACvFC,GAAuB,QAAS,wDAAyD,EACzFC,GAAa,QAAS,iCAAkC,EACxDC,GAAW,QAAS,gCAAiC,EACrDC,GAAe,QAAS,8BAA+B,EACvDC,GAAgB,QAAS,+BAAgC,EACzDC,GAAY,QAAS,2BAA4B,EAAE,YACnDC,GAAoB,QAAS,oCAAqC,EAAE,YACpEC,GAA2B,QAAS,4CAA6C,EACjFC,GAAa,QAAS,8BAA+B,EACrDC,EAAc,QAAS,sBAAuB,EAC9CC,GAAM,QAAS,+BAAgC,EAC/CC,GAAO,QAAS,4BAA6B,EAC7CC,GAAQ,QAAS,yBAA0B,EAC3CC,GAAkB,QAAS,uBAAwB,EACnDC,EAAS,QAAS,uBAAwB,EAC1CC,GAAa,KAMbC,EAAI,IAGJC,GAAI,IAGJC,GAAWV,KAAe,EAG1BW,GAAwB,SAGxBC,GAAa,WAGbC,GAAa,WAGbC,GAAmB,WAGnBC,GAAqB,QAGrBC,GAAqB,WAGrBC,GAA0B,WAG1BC,G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OAAQ,IAAkC,EAS3DD,EAAaC,EAAI,YAAa,IAAuC,EASrED,EAAaC,EAAI,SAAU,IAAoC,EAS/DD,EAAaC,EAAI,kBAAmB,IAA8C,EASlFD,EAAaC,EAAI,cAAe,IAAyC,EASzED,EAAaC,EAAI,QAAS,IAAmC,EAS7DD,EAAaC,EAAI,WAAY,IAAsC,EASnED,EAAaC,EAAI,YAAa,IAAuC,EASrED,EAAaC,EAAI,SAAU,IAAoC,EAS/DD,EAAaC,EAAI,gBAAiB,IAA4C,EAS9ED,EAAaC,EAAI,UAAW,IAAqC,EASjED,EAAaC,EAAI,SAAU,IAAoC,EAS/DD,EAAaC,EAAI,QAAS,IAAmC,EAS7DD,EAAaC,EAAI,UAAW,IAAqC,EASjED,EAAaC,EAAI,UAAW,IAAqC,EAKjEF,GAAO,QAAUE,IC/JjB,IAAIC,GAAc,QAAS,yCAA0C,EAUjEC,GAAK,CAAC,EASVD,GAAaC,GAAI,QAAS,IAAwB,EASlDD,GAAaC,GAAI,OAAQ,IAAuB,EAShDD,GAAaC,GAAI,YAAa,IAAuB,EASrDD,GAAaC,GAAI,SAAU,IAAyB,EASpDD,GAAaC,GAAI,UAAW,IAA0B,EAStDD,GAAaC,GAAI,UAAW,IAA0B,EAStDD,GAAaC,GAAI,UAAW,IAA0B,EAKtD,OAAO,QAAUA", + "names": ["require_rand_uint32", "__commonJSMin", "exports", "module", "UINT32_MAX", "floor", "MAX", "randuint32", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isCollection", "isUint32Array", "isBoolean", "isPositiveInteger", "FLOAT64_MAX_SAFE_INTEGER", "UINT32_MAX", "Uint32Array", "max", "umul", "gcopy", "typedarray2json", "format", "randuint32", "N", "M", "MAX_SEED", "SEED_ARRAY_INIT_STATE", "UPPER_MASK", "LOWER_MASK", "KNUTH_MULTIPLIER", "MAGIC_MULTIPLIER_1", "MAGIC_MULTIPLIER_2", "TEMPERING_COEFFICIENT_1", "TEMPERING_COEFFICIENT_2", "MATRIX_A", "MAG01", "FLOAT64_NORMALIZATION_CONSTANT", "TWO_26", "TWO_32", "ONE", "MAX_NORMALIZED", "STATE_ARRAY_VERSION", "NUM_STATE_SECTIONS", "STATE_SECTION_OFFSET", "OTHER_SECTION_OFFSET", "SEED_SECTION_OFFSET", "STATE_FIXED_LENGTH", "verifyState", "state", "FLG", "s1", "createState", "s", "i", "initState", "seed", "j", "k", "twist", "w", "factory", "options", "STATE", "opts", "slen", "err", "mt19937", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "out", "r", "x", "y", "require_main", "__commonJSMin", "exports", "module", "factory", "randuint32", "mt19937", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "require_arcsine", "__commonJSMin", "exports", "module", "pow", "sin", "HALF_PI", "arcsine", "rand", "a", "b", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "arcsine0", "factory", "opts", "rand", "prng", "err", "a", "b", "arcsine2", "arcsine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "arcsine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "arcsine2", "arcsine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "a", "b", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "arcsine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_coords_array", "__commonJSMin", "exports", "module", "sqrt", "exp", "ln", "V", "coordsArray", "N", "rTail", "X", "f", "i", "require_ratio_array", "__commonJSMin", "exports", "module", "ratioArray", "X", "R", "require_sample_tail", "__commonJSMin", "exports", "module", "ln", "sampleTail", "rand", "rTail", "isNegative", "x", "y", "require_improved_ziggurat", "__commonJSMin", "exports", "module", "abs", "exp", "coordsArray", "ratioArray", "sampleTail", "NUM_BLOCKS", "START_RIGHT_TAIL", "X", "R", "LAST_7_BITS_MASK", "wrap", "randu", "randi", "randn", "f0", "f1", "x2", "x", "u", "i", "j", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isFunction", "isObject", "isBoolean", "hasOwnProp", "isUint32Array", "mt19937", "constantFunction", "noop", "floor", "UINT32_MAX", "typedarray2json", "format", "improvedZiggurat", "factory", "options", "randu", "randi", "randn", "opts", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randn", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_standard_gamma", "__commonJSMin", "exports", "module", "ln", "sqrt", "pow", "ONE_THIRD", "standardGamma", "randu", "randn", "alpha", "flg", "x2", "v0", "v1", "c", "d", "x", "s", "u", "v", "require_sample1", "__commonJSMin", "exports", "module", "pow", "ln", "sample", "randu", "randn", "alpha", "flg", "s4", "A", "s", "t", "u", "x", "y", "require_sample2", "__commonJSMin", "exports", "module", "pow", "ln", "sample", "randu", "randn", "alpha", "beta", "sigma", "flg", "mu", "A", "B", "C", "L", "s", "u", "x", "y", "require_sample3", "__commonJSMin", "exports", "module", "exp", "pow", "ln", "sample", "rand", "alpha", "beta", "lx", "ly", "xy", "v", "x", "y", "require_beta", "__commonJSMin", "exports", "module", "standardGamma", "sample1", "sample2", "sample3", "sample", "randu", "randn", "alpha", "beta", "ga", "gb", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "randu", "isnan", "gcopy", "Uint32Array", "isUint32Array", "assign", "typedarray2json", "format", "validate", "beta0", "factory", "STATE", "rnorm", "alpha", "beta", "opts", "rand", "prng", "FLG", "err", "beta2", "beta1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "beta", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "beta2", "beta1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "alpha", "beta", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "beta", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_gamma", "__commonJSMin", "exports", "module", "ln", "gamma", "randu", "randn", "beta", "d", "c", "flg", "x2", "v0", "v1", "x", "u", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isUint32Array", "isBoolean", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "randu", "isnan", "sqrt", "pow", "gcopy", "Uint32Array", "typedarray2json", "assign", "format", "validate", "gamma0", "ONE_THIRD", "factory", "STATE", "alpha", "rnorm", "beta", "opts", "rand", "prng", "FLG", "err", "c", "d", "gamma2", "gamma1a", "gamma1b", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "gamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_betaprime", "__commonJSMin", "exports", "module", "sample", "rgamma", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "constantFunction", "noop", "gammaFactory", "isnan", "typedarray2json", "format", "validate", "betaprime0", "factory", "rgamma", "alpha", "beta", "opts", "rand", "prng", "err", "betaprime2", "betaprime1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "betaprime", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "betaprime2", "betaprime1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "alpha", "beta", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "betaprime", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "s", "require_cosine", "__commonJSMin", "exports", "module", "quantile", "sample", "rand", "mu", "s", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "cosine0", "factory", "opts", "rand", "prng", "err", "mu", "s", "cosine2", "cosine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "cosine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "cosine2", "cosine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "mu", "s", "wrapper", "require_main", "__commonJSMin", "exports", "module", "factory", "cosine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isInteger", "format", "isnan", "validate", "a", "b", "require_discrete_uniform", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "floor", "discreteUniform", "rand", "a", "b", "result", "RANGE", "range", "limit", "bsize", "mult", "MIN", "MAX", "inc", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randi", "isnan", "isInteger", "typedarray2json", "format", "validate", "discreteUniform0", "factory", "opts", "rand", "prng", "err", "a", "b", "discreteUniform2", "discreteUniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "discreteUniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "uniform2", "uniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "a", "b", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "discreteUniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "contains", "format", "validate", "opts", "dtypes", "options", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isNonNegativeInteger", "isFunction", "isStringArray", "isCollection", "contains", "filledBy", "unary", "ctors", "format", "validate", "Random", "prng", "dtypes", "dtype", "len", "param1", "options", "ctor", "opts", "out", "err", "dt", "wrapper", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "contains", "format", "validate", "opts", "dtypes", "options", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isNonNegativeInteger", "isFunction", "isStringArray", "isCollection", "contains", "filledBy", "nullary", "ctors", "format", "validate", "Random", "prng", "dtypes", "dtype", "len", "options", "ctor", "opts", "out", "err", "dt", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadWriteAccessor", "setReadOnlyAccessor", "setReadOnly", "isStringArray", "isFunction", "isMethodIn", "isPlainObject", "hasOwnProp", "contains", "constantFunction", "noop", "UnaryRandom", "NullaryRandom", "format", "createFactory", "prng", "dtypes", "dtype", "isValidDataType", "factory", "Random", "random", "param1", "assign", "nargs", "base", "opts", "rand", "dt", "rand1", "rand2", "assign1", "assign2", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "options", "out", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_exponential", "__commonJSMin", "exports", "module", "ln", "exponential", "rand", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "exponential0", "factory", "lambda", "opts", "rand", "prng", "exponential2", "exponential1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "gamma2", "gamma1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "alpha", "beta", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "gamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_geometric", "__commonJSMin", "exports", "module", "floor", "ln", "geometric", "rand", "p", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isProbability", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "geometric0", "factory", "opts", "rand", "prng", "p", "geometric2", "geometric1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "geometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "geometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "gamma", "isnan", "typedarray2json", "format", "validate", "factory", "rgamma", "alpha", "beta", "opts", "rand", "prng", "err", "invgamma2", "invgamma1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "invgamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "invgamma2", "invgamma1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "alpha", "beta", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "invgamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "sigma", "require_lognormal", "__commonJSMin", "exports", "module", "exp", "lognormal", "randn", "mu", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "isnan", "typedarray2json", "format", "validate", "lognormal0", "factory", "sigma", "rnorm", "opts", "rand", "prng", "err", "mu", "lognormal2", "lognormal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "lognormal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "lognormal2", "lognormal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "mu", "sigma", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "lognormal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_rand_int32", "__commonJSMin", "exports", "module", "INT32_MAX", "floor", "MAX", "randint32", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isBoolean", "isCollection", "isPositiveInteger", "isInt32Array", "format", "INT32_MAX", "Int32Array", "gcopy", "typedarray2json", "randint32", "NORMALIZATION_CONSTANT", "MAX_SEED", "A", "STATE_ARRAY_VERSION", "NUM_STATE_SECTIONS", "STATE_SECTION_OFFSET", "SEED_SECTION_OFFSET", "STATE_FIXED_LENGTH", "verifyState", "state", "FLG", "s1", "factory", "options", "STATE", "opts", "seed", "slen", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randint32", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_create_table", "__commonJSMin", "exports", "module", "isnan", "NUM_WARMUPS", "createTable", "rand", "table", "N", "v", "i", "require_rand_int32", "__commonJSMin", "exports", "module", "INT32_MAX", "floor", "MAX", "randint32", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isBoolean", "isCollection", "isPositiveInteger", "isInt32Array", "gcopy", "floor", "Int32Array", "INT32_MAX", "typedarray2json", "format", "createTable", "randint32", "NORMALIZATION_CONSTANT", "MAX_SEED", "A", "TABLE_LENGTH", "STATE_ARRAY_VERSION", "NUM_STATE_SECTIONS", "TABLE_SECTION_OFFSET", "STATE_SECTION_OFFSET", "SEED_SECTION_OFFSET", "STATE_FIXED_LENGTH", "SHUFFLE_STATE", "PRNG_STATE", "verifyState", "state", "FLG", "s1", "factory", "options", "STATE", "opts", "seed", "slen", "err", "minstd", "minstdShuffle", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "s", "out", "i", "require_main", "__commonJSMin", "exports", "module", "factory", "randint32", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "mt19937", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "mt19937", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "sigma", "require_normal", "__commonJSMin", "exports", "module", "normal", "rand", "mu", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "isnan", "typedarray2json", "format", "validate", "normal0", "factory", "sigma", "rnorm", "opts", "rand", "prng", "err", "mu", "normal2", "normal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "normal2", "normal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "mu", "sigma", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "minstd", "minstdShuffle", "mt19937", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "typedarray2json", "format", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "uniform", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randu", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "randu", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "randu", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "require_uniform", "__commonJSMin", "exports", "module", "uniform", "rand", "a", "b", "r", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "uniform0", "factory", "opts", "rand", "prng", "err", "a", "b", "uniform2", "uniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "uniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "base", "ctors", "filledBy", "nullary", "binary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "uniform2", "uniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "a", "b", "wrapper", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "uniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isProbability", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "factory", "opts", "rand", "prng", "p", "bernoulli2", "bernoulli1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "bernoulli", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositiveInteger", "isProbability", "format", "validate", "n", "p", "require_sample1", "__commonJSMin", "exports", "module", "sample", "rand", "n", "p", "sum", "i", "require_correction", "__commonJSMin", "exports", "module", "pow", "ONE_12", "ONE_360", "ONE_1260", "correction", "k", "v", "require_sample2", "__commonJSMin", "exports", "module", "floor", "sign", "sqrt", "abs", "ln", "correction", "ONE_SIXTH", "sample", "rand", "n", "p", "alpha", "urvr", "snpq", "npq", "rho", "tmp", "nm", "nr", "us", "km", "nk", "vr", "a", "b", "c", "f", "h", "i", "k", "m", "q", "r", "t", "u", "v", "x", "require_binomial", "__commonJSMin", "exports", "module", "sample1", "sample2", "sample", "rand", "n", "p", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "isPositiveInteger", "isProbability", "randu", "typedarray2json", "format", "validate", "binomial0", "factory", "opts", "rand", "prng", "err", "p", "binomial2", "binomial1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "n", "require_main", "__commonJSMin", "exports", "module", "factory", "binomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_randn", "__commonJSMin", "exports", "module", "sqrt", "ln", "sin", "cos", "TWO_PI", "wrap", "rand", "flg", "r", "randn", "u1", "u2", "a", "b", "require_min", "__commonJSMin", "exports", "module", "sqrt", "ln", "cos", "PI", "COS_PI", "getMin", "min", "a", "require_max", "__commonJSMin", "exports", "module", "sqrt", "ln", "cos", "TWO_PI", "getMax", "min", "a", "b", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "isBoolean", "hasOwnProp", "isUint32Array", "mt19937", "constantFunction", "noop", "typedarray2json", "format", "randn0", "getMin", "getMax", "factory", "options", "randu", "randn", "rand", "opts", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randn", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "x0", "gamma", "require_cauchy", "__commonJSMin", "exports", "module", "tan", "PI", "cauchy", "randn", "x0", "gamma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "randn", "typedarray2json", "format", "validate", "cauchy0", "factory", "gamma", "rnorm", "opts", "rand", "prng", "err", "x0", "cauchy2", "cauchy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "cauchy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "gamma", "typedarray2json", "format", "factory", "rgamma", "rand", "opts", "prng", "k", "chisquare2", "chisquare1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "chisquare", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "chisquare", "typedarray2json", "sqrt", "format", "factory", "rchisq", "rand", "opts", "prng", "k", "chi2", "chi1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "chi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "isPositiveInteger", "format", "validate", "k", "lambda", "require_erlang", "__commonJSMin", "exports", "module", "ln", "erlang", "rand", "k", "lambda", "prod", "i", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "isPositiveInteger", "typedarray2json", "format", "validate", "erlang0", "factory", "lambda", "rand", "opts", "prng", "err", "k", "erlang2", "erlang1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "erlang", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "d1", "d2", "require_f", "__commonJSMin", "exports", "module", "f", "rchisq", "d1", "d2", "x1", "x2", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "chisquare", "isnan", "typedarray2json", "format", "validate", "f0", "factory", "rchisq", "opts", "rand", "prng", "err", "d1", "d2", "f2", "f1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "f", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositiveNumber", "isNumber", "isnan", "format", "validate", "alpha", "s", "m", "require_frechet", "__commonJSMin", "exports", "module", "pow", "ln", "frechet", "rand", "alpha", "s", "m", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "frechet0", "factory", "alpha", "opts", "rand", "prng", "err", "s", "m", "frechet2", "frechet1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "frechet", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "beta", "require_gumbel", "__commonJSMin", "exports", "module", "ln", "gumbel", "rand", "mu", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "gumbel0", "factory", "beta", "opts", "rand", "prng", "err", "mu", "gumbel2", "gumbel1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "gumbel", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "format", "validate", "N", "K", "n", "require_hin", "__commonJSMin", "exports", "module", "factorial", "hin", "rand", "n1", "n2", "k", "p", "u", "x", "require_hypergeometric", "__commonJSMin", "exports", "module", "hin", "hypergeometric", "rand", "N", "K", "n", "n1", "n2", "k", "x", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isNonNegativeInteger", "PINF", "typedarray2json", "format", "validate", "hypergeometric0", "factory", "opts", "rand", "prng", "err", "N", "K", "n", "hypergeometric2", "hypergeometric1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "hypergeometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "a", "b", "require_kumaraswamy", "__commonJSMin", "exports", "module", "pow", "sample", "rand", "a", "b", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "kumaraswamy0", "factory", "opts", "rand", "prng", "err", "a", "b", "kumaraswamy2", "kumaraswamy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "kumaraswamy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "b", "require_laplace", "__commonJSMin", "exports", "module", "sign", "abs", "ln", "laplace", "rand", "mu", "b", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "laplace0", "factory", "opts", "rand", "prng", "err", "mu", "b", "laplace2", "laplace1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "laplace", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "c", "require_levy", "__commonJSMin", "exports", "module", "normalQuantile", "levy", "rand", "mu", "c", "z", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "levy0", "factory", "opts", "rand", "prng", "err", "mu", "c", "levy2", "levy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "levy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "isnan", "format", "validate", "mu", "s", "require_logistic", "__commonJSMin", "exports", "module", "ln", "logistic", "rand", "mu", "s", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "logistic0", "factory", "opts", "rand", "prng", "err", "mu", "s", "logistic2", "logistic1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "logistic", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_knuth", "__commonJSMin", "exports", "module", "exp", "poisson", "rand", "lambda", "p", "k", "require_rejection", "__commonJSMin", "exports", "module", "factorialln", "floor", "sign", "sqrt", "abs", "ln", "LN_SQRT_TWO_PI", "ONE_12", "ONE_360", "poisson", "rand", "lambda", "slambda", "ainv", "urvr", "us", "vr", "a", "b", "k", "u", "v", "require_poisson", "__commonJSMin", "exports", "module", "knuth", "rejection", "poisson", "rand", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "poisson0", "factory", "lambda", "opts", "rand", "prng", "poisson2", "poisson1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "poisson", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "isNumber", "format", "isnan", "validate", "p", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isUint32Array", "isBoolean", "isFunction", "constantFunction", "noop", "isnan", "poisson", "gamma", "gcopy", "Uint32Array", "assign", "typedarray2json", "format", "validate", "factory", "rgamma", "STATE", "rpois", "opts", "prng", "rand", "FLG", "err", "p", "r", "negativeBinomial2", "negativeBinomial1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "negativeBinomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_pareto", "__commonJSMin", "exports", "module", "pow", "pareto", "rand", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "pareto0", "factory", "alpha", "beta", "opts", "rand", "prng", "err", "pareto2", "pareto1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "pareto1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "minstd", "minstdShuffle", "mt19937", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "typedarray2json", "format", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "randi", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "boxMuller", "improvedZiggurat", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "constantFunction", "format", "noop", "typedarray2json", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "normal", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_rayleigh", "__commonJSMin", "exports", "module", "sqrt", "ln", "rayleigh", "rand", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "rayleigh0", "factory", "sigma", "opts", "rand", "prng", "rayleigh2", "rayleigh1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "rayleigh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isPositive", "isObject", "isUint32Array", "isBoolean", "isnan", "isFunction", "constantFunction", "noop", "chisquare", "randn", "gcopy", "Uint32Array", "assign", "typedarray2json", "format", "sqrt", "factory", "rchisq", "STATE", "rnorm", "rand", "opts", "prng", "FLG", "v", "t2", "t1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "t", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "c", "require_triangular", "__commonJSMin", "exports", "module", "sqrt", "triangular", "rand", "a", "b", "c", "fc", "x", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "triangular0", "factory", "opts", "rand", "prng", "err", "a", "b", "c", "triangular2", "triangular1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "triangular", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "k", "lambda", "require_weibull", "__commonJSMin", "exports", "module", "pow", "ln", "weibull", "rand", "k", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "weibull0", "factory", "lambda", "opts", "rand", "prng", "err", "k", "weibull2", "weibull1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "weibull", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prngs", "__commonJSMin", "exports", "module", "prng0", "prng1", "prng2", "prng3", "prng4", "prng5", "prng6", "prng7", "prng8", "prng9", "prng10", "prng11", "prng12", "prng13", "prng14", "prng15", "prng16", "prng17", "prng18", "prng19", "prng20", "prng21", "prng22", "prng23", "prng24", "prng25", "prng26", "prng27", "prng28", "prng29", "prng30", "prng31", "prng32", "prng33", "prng34", "prng35", "prng36", "prng37", "prng38", "prng39", "prng40", "prngs", "require_main", "__commonJSMin", "exports", "module", "isString", "isObject", "isArray", "contains", "Int32Array", "Uint32Array", "table", "TYPED_ARRAY_CTORS", "PRNG_WRAPPERS", "reviveBasePRNG", "key", "value", "factory", "opts", "args", "ctor", "tmp", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "random", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rarcsine", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbern", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbeta", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbetaprime", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isPositiveInteger", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbinom", "iteratorSymbol", "format", "iterator", "n", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rcauchy", "iteratorSymbol", "format", "iterator", "x0", "gamma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rchi", "iteratorSymbol", "format", "iterator", "k", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rchisq", "iteratorSymbol", "format", "iterator", "k", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rcosine", "iteratorSymbol", "format", "iterator", "mu", "s", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isInteger", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "runif", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "isPositiveInteger", "hasOwnProp", "MAX_VALUE", "rerlang", "iteratorSymbol", "format", "iterator", "k", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rexp", "iteratorSymbol", "format", "iterator", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rf", "iteratorSymbol", "format", "iterator", "d1", "d2", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNumber", "isnan", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rfrechet", "iteratorSymbol", "format", "iterator", "alpha", "s", "m", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rgamma", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rgeom", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rgumbel", "iteratorSymbol", "format", "iterator", "mu", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rhypergeom", "iteratorSymbol", "format", "iterator", "N", "K", "n", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rinvgamma", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rkumaraswamy", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlaplace", "iteratorSymbol", "format", "iterator", "mu", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlevy", "iteratorSymbol", "format", "iterator", "mu", "c", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlogis", "iteratorSymbol", "format", "iterator", "mu", "s", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlognorm", "iteratorSymbol", "format", "iterator", "mu", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "minstd", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "minstd", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "mt19937", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isPositiveNumber", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnbinom", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "mu", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rpareto", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rpois", "iteratorSymbol", "format", "iterator", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randi", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randn", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randu", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rrayleigh", "iteratorSymbol", "format", "iterator", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rt", "iteratorSymbol", "format", "iterator", "v", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rtriangular", "iteratorSymbol", "format", "iterator", "a", "b", "c", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "runif", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rweibull", "iteratorSymbol", "format", "iterator", "k", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_discrete_uniform", "__commonJSMin", "exports", "module", "floor", "discreteUniform", "x", "size", "rand", "pos", "out", "N", "i", "require_renormalizing", "__commonJSMin", "exports", "module", "renormalizing", "x", "size", "rand", "probabilities", "probs", "psum", "out", "N", "i", "j", "k", "u", "require_fisher_yates", "__commonJSMin", "exports", "module", "floor", "slice", "fisherYates", "x", "size", "rand", "tmp", "N", "i", "j", "require_vose", "__commonJSMin", "exports", "module", "floor", "vose", "x", "size", "rand", "probabilities", "small", "large", "probs", "alias", "out", "N", "p", "g", "i", "l", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isUnityProbabilityArray", "hasOwnProp", "isBoolean", "isObject", "format", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "isArrayLike", "isTypedArrayLike", "isString", "format", "randu", "copy", "discreteUniform", "renormalizing", "fisherYates", "vose", "defaults", "validate", "slice", "factory", "config", "pool", "conf", "rand", "err", "fcn", "sample1", "sample2", "x", "options", "replace", "xcopy", "probs", "opts", "size", "mutate", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "sample", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "hasOwnProp", "isString", "isObject", "indexOf", "format", "COPY_OPTIONS", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "isArrayLike", "isTypedArrayLike", "isString", "deepCopy", "floor", "randu", "format", "defaults", "validate", "factory", "config", "conf", "rand", "err", "shuffle", "arr", "options", "strflg", "level", "copy", "opts", "out", "tmp", "N", "i", "j", "require_main", "__commonJSMin", "exports", "module", "factory", "shuffle", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rarcsine", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbern", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "isProbability", "format", "assign", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbeta", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbetaprime", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveInteger", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbinom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "n", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "n", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "n", "p", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rcauchy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "x0", "gamma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "x0", "gamma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "x0", "gamma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rchi", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "isPositive", "assign", "format", "RandomStream", "factory", "k", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rchisquare", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rcosine", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "s", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "s", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isInteger", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rduniform", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveInteger", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rerlang", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "lambda", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rexponential", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "lambda", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rf", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "d1", "d2", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "d1", "d2", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "d1", "d2", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rfrechet", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "m", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "s", "m", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "s", "m", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgamma", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgeom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isProbability", "isPlainObject", "assign", "format", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgumbel", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNonNegativeInteger", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rhypergeom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "N", "K", "n", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "N", "K", "n", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "N", "K", "n", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rinvgamma", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rkumaraswamy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlaplace", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlevy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "c", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "c", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "c", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlogistic", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "s", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "s", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlognormal", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "sigma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "minstd", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "minstd", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "mt19937", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rnbinom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "r", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rnorm", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "sigma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rpareto1", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rpoisson", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "lambda", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randi", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randu", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rrayleigh", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "sigma", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rt", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "v", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "v", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "v", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rtriang", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "c", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "c", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "c", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "runiform", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rweibull", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "lambda", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "arcsine", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "arcsine", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "beta", "N", "alpha", "sa", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "beta", "N", "alpha", "sa", "oa", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "betaprime", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "betaprime", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "s", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "om", "s", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "hasOptions", "options", "out", "v1", "require_main", "__commonJSMin", "exports", "module", "nullary", "unary", "prng", "exponential", "N", "lambda", "sl", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "unary", "prng", "exponential", "N", "lambda", "sl", "ol", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "invgamma", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "invgamma", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "lognormal", "N", "mu", "sm", "sigma", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "lognormal", "N", "mu", "sm", "om", "sigma", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "normal", "N", "mu", "sm", "sigma", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "normal", "N", "mu", "sm", "om", "sigma", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "randu", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "randu", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "uniform", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "uniform", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "weibull", "N", "k", "sk", "lambda", "sl", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "weibull", "N", "k", "sk", "ok", "lambda", "sl", "ol", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "setReadOnly", "ns"] }